Skip to content

Commit 4a06065

Browse files
committed
Manage Exceptions to not wait the full wfs_delay
1 parent 73ce4cb commit 4a06065

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

modules/exploits/multi/misc/java_rmi_server.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,20 @@ def exploit
9393
begin
9494
Timeout.timeout(datastore['HTTPDELAY']) { super }
9595
rescue Timeout::Error
96-
# When the server stops due to our timeout, fail and
97-
# don't wait WfsDelay
98-
fail_with(Failure::Unknown, "The HTTP Server didn't get a payload requests")
96+
# When the server stops due to our timeout, re-raise
97+
# RuntimeError so it won't wait the full wfs_delay
98+
raise ::RuntimeError, "Timeout HTTPDELAY expired and the HTTP Server didn't get a payload request"
99+
rescue Msf::Exploit::Failed
100+
# When the server stops due primer failing, re-raise
101+
# RuntimeError so it won't wait the full wfs_delays
102+
raise ::RuntimeError, "Exploit aborted due to failure #{fail_reason} #{(fail_detail || "No reason given")}"
99103
end
100104
end
101105

106+
def peer
107+
"#{rhost}:#{rport}"
108+
end
109+
102110
def primer
103111
connect
104112

0 commit comments

Comments
 (0)