From a97cee4c91038fce8477e2095ea74cc1028d53ab Mon Sep 17 00:00:00 2001 From: Shelby Pace Date: Thu, 25 Apr 2019 15:36:09 -0500 Subject: [PATCH] add ternary expression to set options --- lib/msf/core/exploit/powershell.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msf/core/exploit/powershell.rb b/lib/msf/core/exploit/powershell.rb index 3686faa8cd..0716729cad 100644 --- a/lib/msf/core/exploit/powershell.rb +++ b/lib/msf/core/exploit/powershell.rb @@ -224,7 +224,7 @@ module Exploit::Powershell def cmd_psh_payload(pay, payload_arch, opts = {}) %i[persist prepend_sleep exec_in_place encode_final_payload encode_inner_payload remove_comspec noninteractive wrap_double_quotes no_equals method].map do |opt| - opts[opt] ||= datastore["Powershell::#{opt}"] + opts[opt] = opts[opt].nil? ? datastore["Powershell::#{opt}"] : opts[opt] end unless opts.key? :shorten