Merge pull request #118 from jduck/master

Add error handling for tns_version method
This commit is contained in:
sinn3r 2012-01-19 11:15:33 -08:00
commit 44f0943715
1 changed files with 4 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class Metasploit3 < Msf::Exploit::Remote
def check def check
version = tns_version version = tns_version
if (not version) if (not version)
raise RuntimeError, "Unable to detect version!" raise RuntimeError, "Unable to detect the Oracle version!"
end end
print_status("Oracle version reply: " + version) print_status("Oracle version reply: " + version)
return Exploit::CheckCode::Vulnerable if (version =~ /32-bit Windows: Version 10\.2\.0\.1\.0/) 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 version = tns_version
if (not version) if (not version)
raise RuntimeError, "Unable to detect version!" raise RuntimeError, "Unable to detect the Oracle version!"
end end
if (version =~ /32-bit Windows: Version 10\.2\.0\.1\.0/) 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) res = sock.get_once(-1, 1)
disconnect disconnect
return res return res
rescue EOFError
return nil
end end