fix session upgrading
parent
9658776adf
commit
ca4feb5136
|
@ -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
|
||||
|
|
|
@ -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']
|
||||
|
|
Loading…
Reference in New Issue