Catch first arg with shorten

bug/bundler_fix
Meatballs 2014-04-19 18:54:42 +01:00
parent 67f44072ca
commit 270b4b9728
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 13 additions and 10 deletions

View File

@ -163,18 +163,21 @@ module Exploit::Powershell
# Shorten arg if PSH 2.0+
if opts[:shorten]
# Invoke-Command and Out-File require these options to have
# an additional space before to prevent Powershell code being
# mangled.
arg_string.gsub!(' -Command ', ' -c ')
arg_string.gsub!(' -EncodedCommand ', ' -e ')
arg_string.gsub!(' -ExecutionPolicy ', ' -ep ')
arg_string.gsub!('-EncodedCommand ', ' -e ')
arg_string.gsub!('-ExecutionPolicy ', ' -ep ')
arg_string.gsub!(' -File ', ' -f ')
arg_string.gsub!(' -InputFormat ', ' -i ')
arg_string.gsub!(' -NoExit ', ' -noe ')
arg_string.gsub!(' -NoLogo ', ' -nol ')
arg_string.gsub!(' -NoProfile ', ' -nop ')
arg_string.gsub!(' -NonInteractive ', ' -noni ')
arg_string.gsub!(' -OutputFormat ', ' -o ')
arg_string.gsub!(' -Sta ', ' -s ')
arg_string.gsub!(' -WindowStyle ', ' -w ')
arg_string.gsub!('-InputFormat ', ' -i ')
arg_string.gsub!('-NoExit ', ' -noe ')
arg_string.gsub!('-NoLogo ', ' -nol ')
arg_string.gsub!('-NoProfile ', ' -nop ')
arg_string.gsub!('-NonInteractive ', ' -noni ')
arg_string.gsub!('-OutputFormat ', ' -o ')
arg_string.gsub!('-Sta ', ' -s ')
arg_string.gsub!('-WindowStyle ', ' -w ')
end
#Strip off first space character