Archive for the tag 'World/Group'

How to find World/Group writable files and directories.

Finding world-writable files and directories

#find / -type f \( -perm -2 -o -perm -20 \) -exec ls -lg {} \;

#find / -type d \( -perm -2 -o -perm -20 \) -exec ls -lg {} \;

This will create a huge file with permission of all files having either write permission set to the group or everybody. Check the permissions and eliminate world writable files to everyone, by executing /bin/chmod on the files.

To remove the permission execute.

#/bin/chmod o-w [file-name]