Fix modules broken by @wchen-r7 's 4275a65407 commit.
These modules call check() in the exploit() function and expected to get a CheckCode::Vulnerable, now that check() returns Appears instead of Vulnerable they always refuse to run. I've flipped the logic, based on examples in other modules, now they refuse to run only if check() positively returns Safe.
This commit is contained in:
committed by
Clément Notin
parent
5dc7d4b16e
commit
0f8efec001
@@ -145,7 +145,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
fail_with(Failure::None, 'Session is already elevated')
|
||||
end
|
||||
|
||||
unless check == Exploit::CheckCode::Vulnerable
|
||||
if check == Exploit::CheckCode::Safe
|
||||
fail_with(Failure::NotVulnerable, "Exploit not available on this system")
|
||||
end
|
||||
|
||||
|
||||
@@ -115,7 +115,9 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
|
||||
# Running on Windows XP versions that aren't listed in the supported list
|
||||
# results in a BSOD and so we should not let that happen.
|
||||
return unless check == Exploit::CheckCode::Appears
|
||||
if check == Exploit::CheckCode::Safe
|
||||
fail_with(Failure::NotVulnerable, "Exploit not available on this system")
|
||||
end
|
||||
|
||||
base_addr = 0xffff
|
||||
handle = open_device('\\\\.\\MQAC', 'FILE_SHARE_WRITE|FILE_SHARE_READ', 0, 'OPEN_EXISTING')
|
||||
|
||||
@@ -64,7 +64,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
def check
|
||||
os = sysinfo["OS"]
|
||||
unless (os =~ /windows/i)
|
||||
return Exploit::CheckCode::Unknown
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
|
||||
file_path = expand_path("%windir%") << "\\system32\\win32k.sys"
|
||||
@@ -81,7 +81,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
return Exploit::CheckCode::Appears if revision < 22348
|
||||
end
|
||||
end
|
||||
return Exploit::CheckCode::Unknown
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
fail_with(Failure::NoTarget, "Running against 64-bit systems is not supported")
|
||||
end
|
||||
|
||||
unless check == Exploit::CheckCode::Vulnerable
|
||||
if check == Exploit::CheckCode::Safe
|
||||
fail_with(Failure::NotVulnerable, "Exploit not available on this system")
|
||||
end
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
fail_with(Failure::NoTarget, "Running against 64-bit systems is not supported")
|
||||
end
|
||||
|
||||
unless check == Exploit::CheckCode::Vulnerable
|
||||
if check == Exploit::CheckCode::Safe
|
||||
fail_with(Failure::NotVulnerable, "Exploit not available on this system")
|
||||
end
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
fail_with(Failure::NoTarget, "Running against 64-bit systems is not supported")
|
||||
end
|
||||
|
||||
unless check == Exploit::CheckCode::Vulnerable
|
||||
if check == Exploit::CheckCode::Safe
|
||||
fail_with(Failure::NotVulnerable, "Exploit not available on this system")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user