I have published on Github script to analyze the site files. Can be useful to find changed/hacked files if you are not allowed use any version control system.
Script will scan all files depend from the filter option and store result in to the files.map, that allow you compare the couple maps in future for find changed files. Aslo do sorting by path, filename, extension, size, last modification, last inode change, permissions, file state.

Download here filelist-php

So, how to use it:

  • Put script in to the server
  • Change the script options if need (e.g. current path, exclude filter, default map name)
  • Run it! (open in the browser)
  • As result you will get the full file list table and the file map
  • Script will make the new map file after each click on Scan again, that allow you compare the couple maps in future

Warning! Do not leave this script and the .map files with free access on the server! Use .htaccess for access control.

8 Comments to “ PHP script to get list of files and find changed files on the site ”

  1. Wouter says:

    Many thanks for this script! My site has been hacked and this helped me finding all the infected files.

    One tip / minor feature request: a next and previous option. Now I have to remember on which page I am.

  2. Kashif says:

    Great script, Thank you so much

  3. Bart says:

    Thank you for this script. I second the feature request for a next/previous button.
    Another nice addition would be the possibility to show only the changes when comparing files.
    I used it to clean up a hacked website. Very useful.

  4. kiran says:

    Excellent script.. Thanks a lot..

  5. eli says:

    How can I make sure that people can not run the script by typing http://www.mysite.com/filelist.php?

    Can you explain how is it possible to add more security to the script?

    Thanks very much.

    • Fedik says:

      you can use .htaccess protection, or just do not leave the script on live, and upload only when it really need

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>