fix session upgrading

bug/bundler_fix
Tim 2017-09-05 23:52:38 +08:00
parent 9658776adf
commit ca4feb5136
2 changed files with 3 additions and 13 deletions

View File

@ -1443,14 +1443,9 @@ class Core
session.response_timeout = response_timeout
end
begin
if ['shell', 'powershell'].include?(session.type)
session.init_ui(driver.input, driver.output)
session.execute_script('post/multi/manage/shell_to_meterpreter')
session.reset_ui
else
print_error("Session #{sess_id} is not a command shell session, it is #{session.type}, skipping...")
next
end
session.init_ui(driver.input, driver.output)
session.execute_script('post/multi/manage/shell_to_meterpreter')
session.reset_ui
ensure
if session.respond_to?(:response_timeout) && last_known_timeout
session.response_timeout = last_known_timeout

View File

@ -52,11 +52,6 @@ class MetasploitModule < Msf::Post
def run
print_status("Upgrading session ID: #{datastore['SESSION']}")
if session.type =~ /meterpreter/
print_error("Shell is already Meterpreter.")
return nil
end
# Try hard to find a valid LHOST value in order to
# make running 'sessions -u' as robust as possible.
if datastore['LHOST']