From e06af184c88a4bf671d42b5207b4bf578906efcc Mon Sep 17 00:00:00 2001 From: Carsten Maartmann-Moe Date: Sun, 11 Nov 2018 22:53:13 +0100 Subject: [PATCH] Tidy check method --- .../windows/http/hp_imc_java_deserialize.rb | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/modules/exploits/windows/http/hp_imc_java_deserialize.rb b/modules/exploits/windows/http/hp_imc_java_deserialize.rb index ddd6b377cb..5cadffcc57 100644 --- a/modules/exploits/windows/http/hp_imc_java_deserialize.rb +++ b/modules/exploits/windows/http/hp_imc_java_deserialize.rb @@ -58,21 +58,25 @@ class MetasploitModule < Msf::Exploit::Remote 'method' => 'GET' }) - if res && res.code == 200 && res.body.include?('login_logo_hp.png') - - res = send_request_cgi({ - 'uri' => normalize_uri(target_uri.path, 'topo', 'WebDMDebugServlet'), - 'method' => 'GET' - }) - - if res && res.code == 500 && res.body.include?('HPE Intelligent Management Center') - return Exploit::CheckCode::Appears - end - - return Exploit::CheckCode::Detected + unless res + vprint_error 'Connection failed' + return CheckCode::Unknown end - return Exploit::CheckCode::Safe + unless res.code == 200 && res.body.include?('login_logo_hp.png') + return CheckCode::Safe + end + + res = send_request_cgi({ + 'uri' => normalize_uri(target_uri.path, 'topo', 'WebDMDebugServlet'), + 'method' => 'GET' + }) + + if res && res.code == 500 && res.body.include?('HPE Intelligent Management Center') + return CheckCode::Appears + end + + CheckCode::Detected end def exploit