Land #18019, Fixes validation for `to_handler` command for Evasion and Payload modules
This commit is contained in:
commit
e2718eb40c
|
@ -153,7 +153,8 @@ module Exploit
|
|||
raise $!
|
||||
rescue ::Msf::OptionValidateError => e
|
||||
exploit.error = e
|
||||
::Msf::Ui::Formatter::OptionValidateError.print_error(oexploit, e)
|
||||
::Msf::Ui::Formatter::OptionValidateError.print_error(exploit, e)
|
||||
return false
|
||||
rescue ::Exception => e
|
||||
exploit.error = e
|
||||
exploit.print_error("Exploit failed: #{e}")
|
||||
|
@ -248,4 +249,3 @@ end
|
|||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -91,10 +91,22 @@ class Evasion
|
|||
}
|
||||
|
||||
handler.share_datastore(mod.datastore)
|
||||
handler.exploit_simple(handler_opts)
|
||||
job_id = handler.job_id
|
||||
|
||||
print_status "Payload Handler Started as Job #{job_id}"
|
||||
replicant_handler = nil
|
||||
handler.exploit_simple(handler_opts) do |yielded_replicant_handler|
|
||||
replicant_handler = yielded_replicant_handler
|
||||
end
|
||||
|
||||
if replicant_handler.nil?
|
||||
print_error('Failed to run module')
|
||||
return
|
||||
end
|
||||
|
||||
if replicant_handler.error.nil?
|
||||
job_id = handler.job_id
|
||||
|
||||
print_status "Payload Handler Started as Job #{job_id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -59,10 +59,22 @@ module Msf
|
|||
}
|
||||
|
||||
handler.share_datastore(mod.datastore)
|
||||
handler.exploit_simple(handler_opts)
|
||||
job_id = handler.job_id
|
||||
|
||||
print_status "Payload Handler Started as Job #{job_id}"
|
||||
replicant_handler = nil
|
||||
handler.exploit_simple(handler_opts) do |yielded_replicant_handler|
|
||||
replicant_handler = yielded_replicant_handler
|
||||
end
|
||||
|
||||
if replicant_handler.nil?
|
||||
print_error('Failed to run module')
|
||||
return
|
||||
end
|
||||
|
||||
if replicant_handler.error.nil?
|
||||
job_id = handler.job_id
|
||||
|
||||
print_status "Payload Handler Started as Job #{job_id}"
|
||||
end
|
||||
end
|
||||
|
||||
alias cmd_exploit cmd_to_handler
|
||||
|
|
Loading…
Reference in New Issue