File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
modules/payloads/singles/osx/x86 Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def initialize(info = {})
48
48
def generate_stage
49
49
cmd_str = datastore [ 'CMD' ] || ''
50
50
# Split the cmd string into arg chunks
51
- cmd_parts = cmd_str . split ( /[ \s ]+/ )
51
+ cmd_parts = Shellwords . shellsplit ( cmd_str )
52
52
# the non-exe-path parts of the chunks need to be reversed for execve
53
53
cmd_parts = ( [ cmd_parts . first ] + ( cmd_parts [ 1 ..-1 ] || [ ] ) . reverse ) . compact
54
54
arg_str = cmd_parts . map { |a | "#{ a } \x00 " } . join
@@ -61,7 +61,7 @@ def generate_stage
61
61
62
62
# now EBX contains &cmd_parts[0], the exe path
63
63
if cmd_parts . length > 1
64
- # Build an array of pointers to the arguments we copied on to the stack
64
+ # Build an array of pointers to arguments
65
65
payload += "\x89 \xD9 " + # mov ecx, ebx
66
66
"\x50 " + # push eax; null byte (end of array)
67
67
"\x89 \xe2 " # mov edx, esp (EDX points to the end-of-array null byte)
You can’t perform that action at this time.
0 commit comments