Ive researched around, and finally I have seen that these commands are good for searching for unsecure file/dirs:
find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -ldu '{}' \;
find / -type d \( -perm -4000 -o -perm -2000 \) -exec ls -ldu '{}' \;
find / -type d -perm -0777 -exec ls -ldu '{}' \;
find /home -type f -perm -0777 -exec ls -ldu '{}' \;
1] The two first ones look for setuid files and directories (Latest access time will show instead of creation time - comes handy). On a standard cpanel6 install there are not that much to see (there shouldnt anyway), unless there's a writable dir/file.
I thought that it would be nice to build a script that checks suid/sgid files/dirs _with_ write permissions, but I would like to know if im following the right theory before coding it (Any opinions?).
2] The third command looks for world-writeable directories. On a standard cpanel6 install I got A LOT of them!. Is this really bad, other than possible letting a user scatter files through the server?
3] The fourth and last command looks for world-writable executable files through the standard account directory of cpanel6. This is bad, as by doing this a user can easily hijack other user's account if the file is a .php,.pl, etc, executable file. In plain cpanel6 I think there are no files like this (im unsure).
What about building a script that looks for these world-writeable files on each users web directory, mailing a warning?
......
Well, that's about it. Im dying for opinions
.pd
cPanel.net Support Ticket Number:



LinkBack URL
About LinkBacks
Reply With Quote







