Land #7499, check method for pkexec exploit

bug/bundler_fix
William Vu 2016-11-03 10:58:52 -05:00
commit eca4b73aab
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
1 changed files with 18 additions and 0 deletions

View File

@ -66,6 +66,24 @@ class MetasploitModule < Msf::Exploit::Local
@executable_path
end
def check
# version can be nil
version = cmd_exec('pkexec --version').split.last
# version can be a string, so we check it
if version.nil? || !Gem::Version.correct?(version)
vprint_error('pkexec not found or version incorrect')
return CheckCode::Unknown
end
if Gem::Version.new(version) <= Gem::Version.new('0.101')
vprint_good("pkexec #{version} found")
return CheckCode::Appears
end
CheckCode::Detected
end
def exploit
main = %q^
/*