Skip to content

Commit e23feb0

Browse files
committed
Adds check for ndsudo binary
1 parent aae5356 commit e23feb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/exploits/linux/local/ndsudo_cve_2024_32019.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def initialize(info = {})
5353

5454
def check
5555
# could not find reasonable way to get version
56-
CheckCode::Safe('Vulnerable binary not detected, check NdsudoPath option') unless file?(datastore['NdsudoPath'])
56+
return CheckCode::Safe('Vulnerable binary not detected, check NdsudoPath option') unless file?(datastore['NdsudoPath']) && executable?(datastore['NdsudoPath'])
57+
return CheckCode::Unknown('Failed to run vulnerable binary, either binary is not ndsudo or user does not have right to execute ndsudo') unless cmd_exec(datastore['NdsudoPath']) == 'at least 2 parameters are needed, but 1 were given.'
58+
5759
CheckCode::Appears('Vulnerable binary detected')
5860
end
5961

0 commit comments

Comments
 (0)