Skip to main content

How to Find Recently Changed Website Files After a Suspected Compromise

You can identify files that have been modified or created recently on your web server to help determine the scope of a security breach. This process allows a customer to isolate potentially malicious files for review or removal.

You can identify files that have been modified or created recently on your web server to help determine the scope of a security breach. This process allows a customer to isolate potentially malicious files for review or removal.

Before you begin

You will need:

  • Access to your website's file system via an FTP client or a web-based file manager.

  • A way to view file metadata, such as the "Last Modified" date and time.

Identify modified files via file manager

Most web hosting control panels provide a file manager interface that displays the modification date of every file and folder.

  1. Log in to your hosting control panel.

  2. Open the File Manager tool.

  3. Navigate to the directory containing your website's files (typically public_html or a similar folder).

  4. Look for a column labeled Modified or Last Modified.

  5. Sort the list by the modification date to bring the most recent changes to the top.

  6. Review the files modified within the timeframe of the suspected compromise.

Identify modified files via FTP

If you use an FTP client (such as FileZilla or WinSCP), you can view the modification dates of files directly in the software.

  1. Connect to your server using your FTP credentials.

  2. Navigate to your website's root directory.

  3. Locate the column for Time or Modified.

  4. Sort the list by date to identify files changed recently.

  5. Note the names of any files that were modified unexpectedly.

Identify modified files via command line

If you have SSH access to your server, you can use the find command to list files modified within a specific timeframe.

  1. Connect to your server via SSH.

  2. Navigate to your website's directory.

  3. Run the following command to find files modified in the last 24 hours:

    find . -mtime -1

  4. To find files modified in the last 60 minutes, use:

    find . -mmin -60

Confirm the result

  • You have generated a list of files modified during the period of the suspected compromise.

  • You can now compare these files against a known-clean backup or a standard version of the application (such as a core WordPress file) to identify unauthorized changes.

Limitations

This process identifies files based on the timestamp provided by the server's file system. If an attacker modified a file and then altered the timestamp (a technique known as "timestomping"), the file may not appear in a list of recently changed files. This method identifies changes but does not perform a security scan to determine if the content of those changes is malicious.

Did this answer your question?