Which of the following find commands will print out a list of files owned by root and with the SUID bit set in /usr?

A.

find /usr -uid 0 -perm +4000

B.

find -user root +mode +s /usr

C.

find -type suid -username root -d /usr

D.

find /usr -ls \*s\* -u root

E.

find /usr -suid -perm +4000

題解

「find」指令可以搜索檔案。加上「-uid」參數可以只搜尋特定使用者 ID 所擁有的檔案,UID 0 表示 root。加上「-perm」可以只搜尋擁有特定權限的檔案,SUID 為 4,「+4000」(新版本要改用「/4000」)或是「-4000」都可以找到擁有 SUID 權限的檔案。所以答案是選項 A。