Skip to content

Commit 83360ba

Browse files
committed
Land rapid7#4114, @wchen-r7's change to handle Rex::HostUnreachable
2 parents cd16ee8 + 6f013cd commit 83360ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/auxiliary/gather/xerox_pwd_extract.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def write
9696
begin
9797
connect(true, 'RPORT' => jport)
9898
sock.put(create_print_job)
99-
rescue ::Timeout::Error, Rex::ConnectionError, Rex::ConnectionRefused, HostUnreachable, Rex::ConnectionTimeout, Rex::AddressInUse
99+
rescue ::Timeout::Error, Rex::ConnectionError, Rex::ConnectionRefused, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::AddressInUse
100100
print_error("#{rhost}:#{jport} - Error connecting to #{rhost}")
101101
ensure
102102
disconnect
@@ -113,7 +113,7 @@ def retrieve
113113
res = sock.get_once || ''
114114
passwd = res.match(/\r\n\s(.+?)\n/)
115115
return passwd ? passwd[1] : ''
116-
rescue ::EOFError, ::Timeout::Error, Rex::ConnectionError, Rex::ConnectionRefused, HostUnreachable, Rex::ConnectionTimeout, Rex::AddressInUse, EOFError
116+
rescue ::EOFError, ::Timeout::Error, Rex::ConnectionError, Rex::ConnectionRefused, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::AddressInUse, EOFError
117117
print_error("#{rhost}:#{jport} - Error getting password from #{rhost}")
118118
return
119119
ensure
@@ -150,7 +150,7 @@ def remove
150150
begin
151151
connect(true, 'RPORT' => jport)
152152
sock.put(remove_print_job)
153-
rescue ::Timeout::Error, Rex::ConnectionError, Rex::ConnectionRefused, HostUnreachable, Rex::ConnectionTimeout, Rex::AddressInUse
153+
rescue ::Timeout::Error, Rex::ConnectionError, Rex::ConnectionRefused, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::AddressInUse
154154
print_error("#{rhost}:#{jport} - Error removing print job from #{rhost}")
155155
ensure
156156
disconnect

0 commit comments

Comments
 (0)