Results 1 to 3 of 3
-
09-01-2007, 05:14 PM #1Newbie
- Join Date
- Sep 2005
- Posts
- 18
Simple script to find suspected files and folders
Hello
Try this useful script to find all 777 permission files and folders in /home directory
also it can find all names of suspected folders and files you want
and then you can take the required action
to install this follow the steps
login as root
Code:cd /root
Code:pico checkpandnscript.sh
email@email.com to your email
Code:# This file will help you to find suspected folders and files in /home directory # Coded and desgined by Alrutani Web Hosting www.alrutani.com , for more informations please contact us. #!/bin/sh echo " " > /root/perdfmbc echo "################# Folders with 777 permission #################" >> /root/perdfmbc echo " " >> /root/perdfmbc find /home -type d -perm 777 |egrep -v "./cpapachebuild|./.cpan|./src" >> /root/perdfmbc echo " " >> /root/perdfmbc echo "################## Files with 777 permission ##################" >> /root/perdfmbc echo " " >> /root/perdfmbc find /home -type f -perm 777 >> /root/perdfmbc echo " " >> /root/perdfmbc echo "############### Folders & files must be checked ###############" >> /root/perdfmbc echo " " >> /root/perdfmbc find /home -name forum >> /root/perdfmbc find /home -name upload >> /root/perdfmbc find /home -name 4images >> /root/perdfmbc find /home -name gallery >> /root/perdfmbc find /home -name uploader >> /root/perdfmbc find /home -name up >> /root/perdfmbc find /home -name r57shell >> /root/perdfmbc find /home -name r57shell.php >> /root/perdfmbc find /home -name r57.php >> /root/perdfmbc find /home -name c99shell >> /root/perdfmbc find /home -name c99shell.php >> /root/perdfmbc find /home -name c99.php >> /root/perdfmbc find /home -name shell.php >> /root/perdfmbc echo " " >> /root/perdfmbc echo "###############################################################" >> /root/perdfmbc echo "Developed by Alrutani Web Hosting http://www.alrutani.com" >> /root/perdfmbc echo "For more informations please contact us." >> /root/perdfmbc echo " " >> /root/perdfmbc cat /root/perdfmbc | mail -s "Suspected files & folders in your server" email@email.com cd /root rm -rf perdfmbc # This file will help you to find suspected folders and files in /home directory # Coded and desgined by Alrutani Web Hosting www.alrutani.com , for more informations please contact us.
fine
Code:find /home -name upload >> /root/perdfmbc
Code:find /home -name xxxxxx >> /root/perdfmbc
Save file Ctrl X
select yes then click enter
Code:chmod 755 checkpandnscript.sh
Code:crontab -e
Code:* 3 * * * sh /root/checkpandnscript.sh
now to test the script
Code:cd /root
Code:sh checkpandnscript.sh
█ www.alrutani.com
█ Alrutani Web Hosting
Find your self in alrutani web hosting
It's more then a host, it's a network of minds !!
-
09-01-2007, 06:19 PM #2Web Hosting Master
- Join Date
- Mar 2003
- Location
- Canada
- Posts
- 9,072
All of that, just to check for some 777 directories? You also realize that most "PHP Shell" scripts that get uploaded are renamed?
Better idea:
find /home/*/public_html -type d -perm 777
-
09-01-2007, 06:46 PM #3Newbie
- Join Date
- Sep 2005
- Posts
- 18
Well in the same times some of them just won’t change the php shell file name because 99% of them are following steps
more over it also can check folders you want such as upload
and then you can deal with it by lets say .htaccess files
at least it will provide you with useful issues about the files & folders in the server█ www.alrutani.com
█ Alrutani Web Hosting
Find your self in alrutani web hosting
It's more then a host, it's a network of minds !!