Skip WfsDelay when the exploit has clearly failed

This commit is contained in:
HD Moore
2015-09-15 08:04:23 -07:00
parent abe65cd400
commit b3f754136e
3 changed files with 28 additions and 3 deletions
+3
View File
@@ -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
View File
@@ -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
##
+8
View File
@@ -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
#