@@ -18,6 +18,7 @@ def initialize(info = {})
18
18
OptBool . new ( 'Powershell::noninteractive' , [ true , 'Execute powershell without interaction' , true ] ) ,
19
19
OptBool . new ( 'Powershell::encode_final_payload' , [ true , 'Encode final payload for -EncodedCommand' , false ] ) ,
20
20
OptBool . new ( 'Powershell::encode_inner_payload' , [ true , 'Encode inner payload for -EncodedCommand' , false ] ) ,
21
+ OptBool . new ( 'Powershell::wrap_double_quotes' , [ true , 'Wraps the -Command argument in single quotes' , true ] ) ,
21
22
OptBool . new ( 'Powershell::no_equals' , [ true , 'Pad base64 until no "=" remains' , false ] ) ,
22
23
OptEnum . new ( 'Powershell::method' , [ true , 'Payload delivery method' , 'reflection' , %w[ net reflection old msil ] ] )
23
24
]
@@ -216,13 +217,13 @@ def run_hidden_psh(ps_code, payload_arch, encoded)
216
217
# powershell script
217
218
# @option opts [Boolean] :remove_comspec Removes the %COMSPEC%
218
219
# environment variable at the start of the command line
219
- # @option opts [Boolean] :use_single_quotes Wraps the -Command
220
- # argument in single quotes unless :encode_final_payload
220
+ # @option opts [Boolean] :wrap_double_quotes Wraps the -Command
221
+ # argument in double quotes unless :encode_final_payload
221
222
#
222
223
# @return [String] Powershell command line with payload
223
224
def cmd_psh_payload ( pay , payload_arch , opts = { } )
224
225
%i[ persist prepend_sleep exec_in_place encode_final_payload encode_inner_payload
225
- remove_comspec noninteractive no_equals method ] . map do |opt |
226
+ remove_comspec noninteractive wrap_double_quotes no_equals method ] . map do |opt |
226
227
opts [ opt ] ||= datastore [ "Powershell::#{ opt } " ]
227
228
end
228
229
0 commit comments