mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
test: test compile error
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import com.googlecode.aviator.AviatorEvaluator;
|
||||
import com.googlecode.aviator.AviatorEvaluatorInstance;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/1/29
|
||||
*/
|
||||
class AviatorServletTest {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
String exp = "use org.springframework.cglib.core.*;use org.springframework.util.*;ReflectionUtils.invokeMethod(ClassUtils.getMethod(Class.forName('java.lang.Thread'), 'getContextClassLoader', nil), Thread.currentThread())";
|
||||
AviatorEvaluatorInstance evaluator = AviatorEvaluator.newInstance();
|
||||
System.out.println(evaluator.execute(exp));
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
|
||||
import org.apache.commons.jexl2.Expression;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/1/29
|
||||
*/
|
||||
class JEXL2ServletTest {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
System.out.println(System.getProperty("java.version"));
|
||||
org.apache.commons.jexl2.JexlEngine jexl = new org.apache.commons.jexl2.JexlEngine();
|
||||
Expression e = jexl.createExpression("''.getClass().forName('javax.script.ScriptEngineManager').newInstance().getEngineByName('js')");
|
||||
org.apache.commons.jexl2.MapContext jc = new org.apache.commons.jexl2.MapContext();
|
||||
System.out.println(e.evaluate(jc));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import org.apache.commons.jexl3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/1/29
|
||||
*/
|
||||
class JEXL3ServletTest {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
System.out.println(System.getProperty("java.version"));
|
||||
JexlEngine jexl = new JexlBuilder().create();
|
||||
JexlExpression e = jexl.createExpression("''.getClass().forName('javax.script.ScriptEngineManager').newInstance().getEngineByName('js')");
|
||||
JexlContext jc = new MapContext();
|
||||
System.out.println(e.evaluate(jc));
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user