• You can audit permissions on your Linux system by using the find command with the -perm option. Plus four bonus permissions auditing methods.
  • find / -perm 777 -name test.php. 7. The below find command in linux can check files with SUID bit set with permissions 755.
  • 21. Find All Files with 777 Permissions and chmod to 644. $ find / -type f -perm 0777 -print -exec chmod 644 {} \
  • find . -perm 754. ... find . -perm u=rwx,g=rx,o=r. Same as the above command, but uses a symbolic representation of the permission bits.
  • For example, a file whose permissions are 440 would not show up in a find . -perm -200, despite the value 400 appearing to be “greater than” 200?
    • -newer file: search for the file names that are modified after “file”.
    • -perm octal: search for the files if the permission is ‘octal’.
    Linux Find -perm option.
  • The expression will define how to search and match files and what to do with them. Here you see that find is very powerful and has a lot of options.
  • To find files based on their set permissions, you will need to use the “-perm” option, followed by the numerical permission.
  • You can also omit the filename to get any files of the type stated. Such as find / -perm 777 will return every file with 777 (unlimited) access.
  • So, if we want to find all those files that hold the SUID bit then it can be retrieved by typing the command: find / -perm -u=s -type f 2>/dev/null.