Fix payload selection
parent
1ca690eccf
commit
0956ae5789
|
@ -244,6 +244,7 @@ EOS
|
||||||
def cmd_psh_payload(pay, payload_arch, opts={})
|
def cmd_psh_payload(pay, payload_arch, opts={})
|
||||||
opts[:persist] ||= datastore['Powershell::persist']
|
opts[:persist] ||= datastore['Powershell::persist']
|
||||||
opts[:prepend_sleep] ||= datastore['Powershell::prepend_sleep']
|
opts[:prepend_sleep] ||= datastore['Powershell::prepend_sleep']
|
||||||
|
opts[:method] ||= datastore['Powershell::method']
|
||||||
|
|
||||||
if opts[:encode_inner_payload] && opts[:encode_final_payload]
|
if opts[:encode_inner_payload] && opts[:encode_final_payload]
|
||||||
raise RuntimeError, ":encode_inner_payload and :encode_final_payload are incompatible options"
|
raise RuntimeError, ":encode_inner_payload and :encode_final_payload are incompatible options"
|
||||||
|
@ -253,7 +254,7 @@ EOS
|
||||||
raise RuntimeError, ":no_equals requires :encode_final_payload option to be used"
|
raise RuntimeError, ":no_equals requires :encode_final_payload option to be used"
|
||||||
end
|
end
|
||||||
|
|
||||||
psh_payload = case datastore['PSH::method']
|
psh_payload = case opts[:method]
|
||||||
when 'net'
|
when 'net'
|
||||||
Msf::Util::EXE.to_win32pe_psh_net(framework, pay)
|
Msf::Util::EXE.to_win32pe_psh_net(framework, pay)
|
||||||
when 'reflection'
|
when 'reflection'
|
||||||
|
@ -261,7 +262,9 @@ EOS
|
||||||
when 'old'
|
when 'old'
|
||||||
Msf::Util::EXE.to_win32pe_psh(framework, pay)
|
Msf::Util::EXE.to_win32pe_psh(framework, pay)
|
||||||
when 'msil'
|
when 'msil'
|
||||||
raise RuntimeError, "MSIL Powershell Technique no longer exists"
|
raise RuntimeError, "MSIL Powershell method no longer exists"
|
||||||
|
else
|
||||||
|
raise RuntimeError, "No Powershell method specified"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Run our payload in a while loop
|
# Run our payload in a while loop
|
||||||
|
|
Loading…
Reference in New Issue