From ae33e3ac71f0ea9ad43f89d32f07dbdce07815e3 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Fri, 21 Jan 2011 04:09:48 +0000 Subject: [PATCH] Fixes #3571, normalize 2k3r2 and fix language defaulting git-svn-id: file:///home/svn/framework3/trunk@11614 4d416f70-5f16-0410-b530-b9f4589650da --- modules/exploits/windows/smb/ms08_067_netapi.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/exploits/windows/smb/ms08_067_netapi.rb b/modules/exploits/windows/smb/ms08_067_netapi.rb index 23f2d9975c..1bab7332b5 100644 --- a/modules/exploits/windows/smb/ms08_067_netapi.rb +++ b/modules/exploits/windows/smb/ms08_067_netapi.rb @@ -758,13 +758,11 @@ class Metasploit3 < Msf::Exploit::Remote print_status("Automatically detecting the target...") fprint = smb_fingerprint() - print_status("Fingerprint: #{fprint['os']} #{fprint['sp']} - lang:#{fprint['lang']}") + print_status("Fingerprint: #{fprint['os']} - #{fprint['sp']} - lang:#{fprint['lang']}") # Bail early on unknown OS if(fprint['os'] == 'Unknown') - print_status("No matching target") - disconnect - return + raise RuntimeError, "No matching target" end # Windows 2000 is mostly universal @@ -782,6 +780,11 @@ class Metasploit3 < Msf::Exploit::Remote mytarget = self.targets[5] end + # Windows 2003 R2 is treated the same as 2003 + if(fprint['os'] == 'Windows 2003 R2') + fprint['os'] = 'Windows 2003' + end + # Service Pack match must be exact if((not mytarget) and fprint['sp'].index('+')) print_error("Could not determine the exact service pack") @@ -793,7 +796,7 @@ class Metasploit3 < Msf::Exploit::Remote # Language Pack match must be exact or we default to English if((not mytarget) and fprint['lang'] == 'Unknown') print_status("We could not detect the language pack, defaulting to English") - fprint['lang'] == 'English' + fprint['lang'] = 'English' end # Normalize the service pack string @@ -809,9 +812,7 @@ class Metasploit3 < Msf::Exploit::Remote end if(not mytarget) - print_error("No matching target") - disconnect - return + raise RuntimeError, "No matching target" end print_status("Selected Target: #{mytarget.name}")