mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-06-15 15:03:41 +02:00

In posix, a command like "echo 'foo bar'" would previously get parsed out into arguments for execve like [ "echo", "'foo", "bar'" ] which obviously isn't what you want. After this commit, it sticks the whole thing in an arg to sh so the execve call ends up looking like execve("/bin/sh", ["sh", "-c", "echo 'foo bar'"], [/* 26 vars */]) = 0 This is still a little less than ideal because shell escapes become a problem; fortunately, that's easy to deal with on the client side as long as module developers take it into account.