Results 1 to 3 of 3
  1. #1

    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
    Enter this code and in the 5th line from the end change
    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.
    To add more files and folders that you want the system to list

    fine
    Code:
    find /home -name upload >> /root/perdfmbc
    after it add
    Code:
    find /home -name xxxxxx >> /root/perdfmbc
    where xxxxx is the name of the file or the folder you want

    Save file Ctrl X
    select yes then click enter

    Code:
    chmod 755 checkpandnscript.sh
    To make the script works daily

    Code:
    crontab -e
    At the end enter
    Code:
    * 3 * * * sh /root/checkpandnscript.sh
    save and exit done !!


    now to test the script

    Code:
    cd /root
    Code:
    sh checkpandnscript.sh
    you will receive email from 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 !!

  2. #2
    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

  3. #3
    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 !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •