How to Find Recently Changed Files in cPanel File Manager

Investigate: how to find recently changed files

When a website is hacked, the attacker’s files are usually the newest ones on it. Spam folders, web shells and fake verification files all have to be uploaded at some point, and the server records when. So one of the first things I do on a hacked site is sort its files by date and look at what changed recently.

This guide shows how to do that in cPanel’s File Manager, and how to do the same search faster in the Terminal.

Step 1: Open File Manager and show hidden files

  1. Log in to cPanel and click File Manager (in the Files section).
  2. Click Settings in the top right corner.
  3. Tick Show Hidden Files (dotfiles) and click Save.

Hidden files are files whose name starts with a dot, such as .htaccess or .user.ini. Attackers like them because File Manager hides them by default. Leave this setting on whenever you are checking a site.

Step 2: Go to the website folder

In the left-hand panel, click public_html, or the folder of the site you are checking. You will see the WordPress folders (wp-admin, wp-content, wp-includes) and files like index.php and wp-config.php.

Step 3: Sort by “Last Modified”

Click the Last Modified column heading. Click it again to put the newest files at the top.

Now read the top of the list carefully. On a site that hasn’t been updated recently, you should see very little that is new. What I look for:

  • A folder with an ordinary-sounding name you didn’t create, such as about, contact or news. A real folder can override a WordPress page of the same name.
  • A file named like google0a1b2c3d4e5f6a7b.html. This is a Google Search Console verification file. If you didn’t add it, someone is trying to claim your site in Google.
  • PHP files with random names, like x7k2p.php or wp-cache-a83d.php, sitting where they don’t belong.
  • Several things created within a minute or two of each other. That usually means one person doing a planned job.

Step 4: Check inside the folders that matter

File Manager only sorts the folder you are looking at. It doesn’t search inside subfolders. So repeat Step 3 inside the places attackers use most:

  • wp-content/uploads and the year and month folders inside it
  • wp-content/plugins
  • wp-content/mu-plugins (if it exists, check every file in it)
  • wp-includes and wp-admin

Inside wp-content/plugins, sorting by date also shows plugins that were installed recently. A plugin folder you don’t recognise, with a recent date, deserves a closer look.

Step 5: Do the same search in seconds with the Terminal

Clicking through folders is slow on a big site. If you have the Terminal (see my guide on opening the Terminal in cPanel and running WP-CLI), one command searches every folder at once.

Files changed in the last 7 days:

find ~/public_html -type f -mtime -7

Files changed since a particular date, newest first, with their date and size:

find ~/public_html -type f -newermt "2026-10-01" -printf '%TY-%Tm-%Td %TH:%TM  %8s  %p\n' | sort -r

Only PHP files changed in the last 30 days:

find ~/public_html -type f -name '*.php' -mtime -30

Change the number or the date to suit the time you think the hack started.

One warning: dates can be faked

An attacker can change a file’s “last modified” date to make it look old. This is called timestomping. So a clean-looking date list does not prove a site is clean.

The server keeps a second date, the “change time”, which records when the file’s details last changed. It is much harder to fake. In the Terminal you can search by it instead:

find ~/public_html -type f -ctime -7

If this shows files that the normal search didn’t, someone has tried to hide them.

What to do with what you find

Don’t delete anything yet. Write down each suspicious file’s name, folder, size and date, or take a screenshot. That list becomes your timeline, and it tells you where else to look. In my security series I explain how I used exactly this kind of list to work out how an attacker got in, and how I cleaned the site afterwards without losing that evidence.

Ready to start your project?

Share what you need, and the next steps follow.

Planning a project?

Your details are used only to answer your request. Privacy notice