feat: support probe mode

This commit is contained in:
ReaJason
2025-12-08 01:43:41 +08:00
parent 653665e479
commit cd8111d0d7
78 changed files with 929 additions and 51 deletions
@@ -0,0 +1,24 @@
package com.reajason.javaweb.vul.springboot1.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ReaJason
* @since 2025/12/6
*/
@RestController
@RequestMapping("/biginteger")
public class BigIntegerClassLoaderController extends ClassLoader {
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));
}
@PostMapping
public void base64ClassLoader(String data) throws Exception {
byte[] bytes = decodeBigInteger(data);
defineClass(null, bytes, 0, bytes.length).newInstance();
}
}
@@ -0,0 +1,24 @@
package com.reajason.javaweb.vul.springboot2.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ReaJason
* @since 2025/12/6
*/
@RestController
@RequestMapping("/biginteger")
public class BigIntegerClassLoaderController extends ClassLoader {
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));
}
@PostMapping
public void base64ClassLoader(String data) throws Exception {
byte[] bytes = decodeBigInteger(data);
defineClass(null, bytes, 0, bytes.length).newInstance();
}
}
@@ -0,0 +1,24 @@
package com.reajason.javaweb.vul.springboot3.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ReaJason
* @since 2025/12/6
*/
@RestController
@RequestMapping("/biginteger")
public class BigIntegerClassLoaderController extends ClassLoader {
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));
}
@PostMapping
public void base64ClassLoader(String data) throws Exception {
byte[] bytes = decodeBigInteger(data);
defineClass(null, bytes, 0, bytes.length).newInstance();
}
}
@@ -25,8 +25,7 @@ public class BigIntegerClassLaoderServlet extends ClassLoader implements Servlet
String data = req.getParameter("data");
try {
byte[] bytes = decodeBigInteger(data);
Object obj = defineClass(null, bytes, 0, bytes.length).newInstance();
res.getWriter().print(obj);
defineClass(null, bytes, 0, bytes.length).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -22,8 +22,7 @@ public class BigIntegerClassLaoderServlet extends ClassLoader implements Servlet
String data = req.getParameter("data");
try {
byte[] bytes = decodeBigInteger(data);
Object obj = defineClass(null, bytes, 0, bytes.length).newInstance();
res.getWriter().print(obj);
defineClass(null, bytes, 0, bytes.length).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -3,7 +3,6 @@ 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