Skip to content

Commit 3d4d6e9

Browse files
committed
Crawler aux mixin updated to catch the mysterious and anonymous timeout exception and re-raise it as a Timeout::Error
1 parent be85cf5 commit 3d4d6e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/msf/core/auxiliary/crawler.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,14 @@ def crawl_target(t)
215215
rescue ::Timeout::Error
216216
# Bubble this up to the top-level handler
217217
raise $!
218-
rescue ::Exception => e
218+
rescue ::Exception => e
219+
# Ridiculous f'ing anonymous timeout exception which I've no idea
220+
# how it comes into existence.
221+
if e.to_s =~ /execution expired/
222+
raise ::Timeout::Error
223+
else
219224
print_error("Crawler Exception: #{url} #{e} #{e.backtrace}")
225+
end
220226
ensure
221227
@crawler.shutdown rescue nil
222228
@crawler = nil

0 commit comments

Comments
 (0)