File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -1197,9 +1197,15 @@ def handler_enabled?
1197
1197
# value can be one of the Handler::constants.
1198
1198
#
1199
1199
def handler ( *args )
1200
- return if not payload_instance
1201
- return if not handler_enabled?
1202
- return payload_instance . handler ( *args )
1200
+ unless payload_instance && handler_enabled?
1201
+ payload_instance . handler ( *args )
1202
+ end
1203
+ end
1204
+
1205
+ def interrupt_handler
1206
+ if payload_instance && handler_enabled? && payload_instance . respond_to? ( :interrupt_wait_for_session )
1207
+ payload_instance . interrupt_wait_for_session ( )
1208
+ end
1203
1209
end
1204
1210
1205
1211
##
@@ -1351,6 +1357,9 @@ def handle_exception e
1351
1357
1352
1358
# Report the failure (and attempt) in the database
1353
1359
self . report_failure
1360
+
1361
+ # Interrupt any session waiters in the handler
1362
+ self . interrupt_handler
1354
1363
end
1355
1364
1356
1365
def report_failure
Original file line number Diff line number Diff line change @@ -163,6 +163,14 @@ def wait_for_session(t = wfs_delay)
163
163
return session
164
164
end
165
165
166
+ #
167
+ # Interrupts a wait_for_session call by notifying with a nil event
168
+ #
169
+ def interrupt_wait_for_session
170
+ return unless session_waiter_event
171
+ session_waiter_event . notify ( nil )
172
+ end
173
+
166
174
#
167
175
# Set by the exploit module to configure handler
168
176
#
You can’t perform that action at this time.
0 commit comments