mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-23 23:41:52 +08:00
feat: support H2 packer
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
package com.reajason.javaweb.vul.springboot2.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/6/27
|
||||
*/
|
||||
@RestController
|
||||
public class JDBCController {
|
||||
|
||||
@PostMapping("/jdbc")
|
||||
public void JDBC(String data) throws Exception {
|
||||
try {
|
||||
Connection connection = DriverManager.getConnection(data);
|
||||
connection.close();
|
||||
} catch (Throwable e) {
|
||||
Throwable ex = e.getCause();
|
||||
while (ex.getCause() != null) {
|
||||
ex = ex.getCause();
|
||||
}
|
||||
if (!(ex instanceof ClassCastException)) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user