We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5169341 + 1c746c0 commit eca4b73Copy full SHA for eca4b73
modules/exploits/linux/local/pkexec.rb
@@ -66,6 +66,24 @@ def executable_path
66
@executable_path
67
end
68
69
+ def check
70
+ # version can be nil
71
+ version = cmd_exec('pkexec --version').split.last
72
+
73
+ # version can be a string, so we check it
74
+ if version.nil? || !Gem::Version.correct?(version)
75
+ vprint_error('pkexec not found or version incorrect')
76
+ return CheckCode::Unknown
77
+ end
78
79
+ if Gem::Version.new(version) <= Gem::Version.new('0.101')
80
+ vprint_good("pkexec #{version} found")
81
+ return CheckCode::Appears
82
83
84
+ CheckCode::Detected
85
86
87
def exploit
88
main = %q^
89
/*
0 commit comments