Skip WfsDelay when the exploit has clearly failed
This commit is contained in:
@@ -237,6 +237,9 @@ module Exploit
|
||||
|
||||
# Report the failure (and attempt) in the database
|
||||
self.report_failure
|
||||
|
||||
# Interrupt any session waiters in the handler
|
||||
self.interrupt_handler
|
||||
end
|
||||
#
|
||||
# Calls the class method.
|
||||
|
||||
+17
-3
@@ -1193,9 +1193,23 @@ class Exploit < Msf::Module
|
||||
# value can be one of the Handler::constants.
|
||||
#
|
||||
def handler(*args)
|
||||
return if not payload_instance
|
||||
return if not handler_enabled?
|
||||
return payload_instance.handler(*args)
|
||||
return unless (
|
||||
payload_instance &&
|
||||
handler_enabled?
|
||||
)
|
||||
payload_instance.handler(*args)
|
||||
end
|
||||
|
||||
#
|
||||
# Break out of the session wait loop (WfsDelay)
|
||||
#
|
||||
def interrupt_handler
|
||||
return unless (
|
||||
payload_instance &&
|
||||
handler_enabled? &&
|
||||
payload_instance.respond_to?(:interrupt_wait_for_session)
|
||||
)
|
||||
payload_instance.interrupt_wait_for_session()
|
||||
end
|
||||
|
||||
##
|
||||
|
||||
@@ -162,6 +162,14 @@ module Handler
|
||||
return session
|
||||
end
|
||||
|
||||
#
|
||||
# Interrupts a wait_for_session call by notifying with a nil event
|
||||
#
|
||||
def interrupt_wait_for_session
|
||||
return unless session_waiter_event
|
||||
session_waiter_event.notify(nil)
|
||||
end
|
||||
|
||||
#
|
||||
# Set by the exploit module to configure handler
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user