mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
feat: support JXPathSpringGzipPacker
This commit is contained in:
@@ -19,6 +19,9 @@ dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
runtimeOnly("com.h2database:h2")
|
||||
implementation("ognl:ognl:2.7.3")
|
||||
implementation("commons-jxpath:commons-jxpath:1.3")
|
||||
implementation("commons-beanutils:commons-beanutils:1.9.3")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.reajason.javaweb.vul.springboot3.controller;
|
||||
|
||||
import org.apache.commons.jxpath.JXPathContext;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jxpath")
|
||||
public class JXPathController {
|
||||
@PostMapping
|
||||
protected Object doPost(String data) {
|
||||
JXPathContext context = JXPathContext.newContext(null);
|
||||
return context.getValue(data);
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.reajason.javaweb.vul.springboot3.controller;
|
||||
|
||||
import ognl.Ognl;
|
||||
import ognl.OgnlContext;
|
||||
import ognl.OgnlException;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ognl")
|
||||
public class OgnlController {
|
||||
@RequestMapping
|
||||
protected Object doPost(String data) {
|
||||
OgnlContext context = new OgnlContext();
|
||||
try {
|
||||
return Ognl.getValue(data, context, context.getRoot());
|
||||
} catch (OgnlException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user