Fix payload selection

bug/bundler_fix
Meatballs 2014-03-02 20:56:55 +00:00
parent 1ca690eccf
commit 0956ae5789
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 5 additions and 2 deletions

View File

@ -244,6 +244,7 @@ EOS
def cmd_psh_payload(pay, payload_arch, opts={})
opts[:persist] ||= datastore['Powershell::persist']
opts[:prepend_sleep] ||= datastore['Powershell::prepend_sleep']
opts[:method] ||= datastore['Powershell::method']
if opts[:encode_inner_payload] && opts[:encode_final_payload]
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"
end
psh_payload = case datastore['PSH::method']
psh_payload = case opts[:method]
when 'net'
Msf::Util::EXE.to_win32pe_psh_net(framework, pay)
when 'reflection'
@ -261,7 +262,9 @@ EOS
when 'old'
Msf::Util::EXE.to_win32pe_psh(framework, pay)
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
# Run our payload in a while loop