Land #7499, check method for pkexec exploit
commit
eca4b73aab
|
@ -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^
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue