Fixes #215. Reinitialize the input/output after a reload

git-svn-id: file:///home/svn/framework3/trunk@5851 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-11-08 17:48:21 +00:00
parent 5af9abd81d
commit d1052fdaf1
1 changed files with 13 additions and 20 deletions

View File

@ -160,33 +160,26 @@ class Exploit
# vulnerable.
#
def cmd_rcheck(*args)
begin
self.mod = framework.modules.reload_module(mod)
cmd_check(*args)
rescue
log_error("Failed to rcheck: #{$!}")
end
self.mod = framework.modules.reload_module(mod)
self.mod.init_ui(driver.input, driver.output)
cmd_check(*args)
end
#
# Reloads an exploit module and launches an exploit.
#
def cmd_rexploit(*args)
begin
if mod.job_id
print_status("Stopping existing job...")
if mod.job_id
print_status("Stopping existing job...")
framework.jobs.stop_job(mod.job_id)
mod.job_id = nil
end
self.mod = framework.modules.reload_module(mod)
cmd_exploit(*args)
rescue
log_error("Failed to rexploit: #{$!}")
framework.jobs.stop_job(mod.job_id)
mod.job_id = nil
end
self.mod = framework.modules.reload_module(mod)
self.mod.init_ui(driver.input, driver.output)
cmd_exploit(*args)
end
end