From 292332d35566b9601322d506412f075107528917 Mon Sep 17 00:00:00 2001 From: "Joshua J. Drake" Date: Thu, 19 Jan 2012 13:03:19 -0600 Subject: [PATCH] Add some error handling for tns_version method --- modules/exploits/windows/oracle/tns_auth_sesskey.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/exploits/windows/oracle/tns_auth_sesskey.rb b/modules/exploits/windows/oracle/tns_auth_sesskey.rb index 35bfdc7199..9413dc2d2a 100644 --- a/modules/exploits/windows/oracle/tns_auth_sesskey.rb +++ b/modules/exploits/windows/oracle/tns_auth_sesskey.rb @@ -80,7 +80,7 @@ class Metasploit3 < Msf::Exploit::Remote def check version = tns_version if (not version) - raise RuntimeError, "Unable to detect version!" + raise RuntimeError, "Unable to detect the Oracle version!" end print_status("Oracle version reply: " + version) return Exploit::CheckCode::Vulnerable if (version =~ /32-bit Windows: Version 10\.2\.0\.1\.0/) @@ -97,7 +97,7 @@ class Metasploit3 < Msf::Exploit::Remote version = tns_version if (not version) - raise RuntimeError, "Unable to detect version!" + raise RuntimeError, "Unable to detect the Oracle version!" end if (version =~ /32-bit Windows: Version 10\.2\.0\.1\.0/) @@ -253,6 +253,8 @@ class Metasploit3 < Msf::Exploit::Remote res = sock.get_once(-1, 1) disconnect return res + rescue EOFError + return nil end