From 69dcd7e53f1b9aef46138054d8c6c7bf62eaa665 Mon Sep 17 00:00:00 2001 From: asoto-r7 Date: Wed, 6 Feb 2019 21:34:54 -0600 Subject: [PATCH] Updated errors and failure mechanisms --- modules/auxiliary/gather/cisco/cisco_rv320_config.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/auxiliary/gather/cisco/cisco_rv320_config.rb b/modules/auxiliary/gather/cisco/cisco_rv320_config.rb index 1942214b6d..3f74e96731 100644 --- a/modules/auxiliary/gather/cisco/cisco_rv320_config.rb +++ b/modules/auxiliary/gather/cisco/cisco_rv320_config.rb @@ -80,15 +80,15 @@ class MetasploitModule < Msf::Auxiliary 'uri' => uri, 'method' => 'GET', }, 60) + rescue OpenSSL::SSL::SSLError + fail_with(Failure::UnexpectedReply, "SSL handshake failed. Consider setting 'SSL' to 'false' and trying again.") end if res.nil? - print_error("#{rhost} - Failed! Got back an empty response.") - print_error("Please validate the RHOST and TARGETURI options and try again.") + fail_with(Failure::UnexpectedReply, "Empty response. Please validate the RHOST and TARGETURI options and try again.") return elsif res.code != 200 - print_error("#{rhost} - Failed! Got back a #{res.code} HTTP response.") - print_error("Please validate the RHOST and TARGETURI options and try again.") + fail_with(Failure::UnexpectedReply, "Unexpected HTTP #{res.code} response. Please validate the RHOST and TARGETURI options and try again.") return else body = res.body