find . -perm 777
will return all directories that are set to 777. It runs recursively from your current directory,
so if you have a lot of files, it may take the server a while.
find . -perm 777 -name "*.*"
will return all files that are set to 777.
find . -perm 777 -name "*.php"
will return all files that are set to 777 and are php files.
fine . -perm 777 > temp.txt
if you have a lot of results, you may want to send the results to a text file rather than see
them on the screen. the > command (which is called a pipe because it pipes results to something else) will send results to a file, in this case
temp.txt.
Scanning files for specific code:
You may also need to scan files for specific code if you think they are infected,
this can be done recursively from any position with this command, which will return
files names containing the string of code to the screen:
grep -r -l 'string' *
string: is the code or phrase you are searching for
-r says it is recursive
-l tells it to print out file names
Changing permissions recursively:
Once you find bad files, you may want to change a bunch of permissions recursively,
else you would have to do them one by one. You can resursively scan and change
files throughout the file structure in one commend:
find . -name '*.php' -exec chmod 755 {} \;
changes all php files recursively to permisson 755