350-201(NEW-127Q) · Question #74
During an internal audit, an information security officer discovered that some non-authorized users have executable privileges on all files in the system, but the script did not work. What must the…
The correct answer is D. sudo -u $userspec find / -type f -executable. Option D is correct because find / -type f -executable is the proper command to recursively search the entire filesystem (/) for regular files (-type f) that have the executable bit set (-executable), and sudo -u $userspec runs that search in the context of the specified user…
Question
Options
- Asudo -u $userspec grep -lF executable
- Bsudo -u $userspec grep -type executable
- Csudo -u $userspec find / -type D -executable
- Dsudo -u $userspec find / -type f -executable
How the community answered
(38 responses)- A3% (1)
- B13% (5)
- C8% (3)
- D76% (29)
Explanation
Option D is correct because find / -type f -executable is the proper command to recursively search the entire filesystem (/) for regular files (-type f) that have the executable bit set (-executable), and sudo -u $userspec runs that search in the context of the specified user - revealing which files that user can execute.
Why the distractors fail:
- A uses
grep -lF executable, butgrepsearches file contents, not file permissions or metadata - it cannot detect executable bits at all. - B also misuses
grepwith a-typeflag thatgrepdoesn't even support;-typeis afindoption, not agrepoption. - C uses
-type D(capital D), which is invalid infind; the correct flag for directories is lowercase-type d- and the goal here is to find files, not directories anyway.
Memory tip: Think "Find Files, not Grep" - grep digs inside file content, while find interrogates file properties like type and permissions. When hunting for executable files on the filesystem, always reach for find -type f -executable.
Topics
Community Discussion
No community discussion yet for this question.