Skip to content

Commit 507050b

Browse files
committed
rescue from down memcached server or timeout
1 parent 0e893cd commit 507050b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/auxiliary/gather/memcached_extractor.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ def determine_version
7878

7979
def run
8080
print_status("#{rhost}:#{rport} - Connecting to memcached server...")
81-
if connect
81+
begin
82+
connect
8283
print_good("Connected to memcached #{determine_version}")
8384
keys = enumerate_keys
8485
print_good("Found #{keys.size} keys")
8586
data = data_for_keys(keys)
8687
rhost = 'localhost.memcached' if %w(localhost 127.0.0.1).include?(rhost)
8788
store_loot('memcached.dump', 'text/plain', rhost, data, 'memcached.txt', 'Memcached extractor')
8889
print_good("Loot stored!")
89-
else
90-
print_error("Could not connect to memcached server! #{e}")
91-
return
90+
rescue Rex::ConnectionRefused, Rex::ConnectionTimeout
91+
print_error("Could not connect to memcached server!")
9292
end
9393
end
9494
end

0 commit comments

Comments
 (0)