Check reference

Suspicious files

What it checks

Finds double extensions, hidden files, PHP files in image or asset folders, PHP code inside images and known web shell names.

Check ID: files.suspicious

The names and locations of the files in the scan targets are checked. The contents are not read, except the first 4 KB of image files.

  • Double extensions such as .php.jpg or .jpg.php.
  • Names that start with a dot. Common configuration files of development tools (such as .gitignore, .editorconfig and .eslintrc) are not reported.
  • PHP files in folders named images, image, img, imgs, icons, fonts, font, css, media, uploads, svg, video or videos.
  • PHP file names often used by web shells, and PHP extensions other than .php and .inc.
  • PHP code at the start of image files (SVG excluded).

What a finding means

The titles, severities and explanations below are the ones shown on the Findings screen.

FindingSeverityMeaning
Double file extension
suspicious.double_extension
HighThe file name has two extensions, a trick used to upload executable files disguised as images or documents.
Hidden PHP file
suspicious.hidden_php
CriticalA PHP file whose name starts with a dot is hidden from normal directory listings. Backdoors are often stored this way.
.htaccess inside the directory
suspicious.htaccess
MediumAn .htaccess file can change how the server executes files. Attackers use it to enable PHP in unexpected places or to redirect visitors.
Hidden file
suspicious.hidden_file
LowA file whose name starts with a dot was found.
PHP file in an asset folder
suspicious.php_in_assets
HighImage, font and CSS folders should not contain PHP. A PHP file here is often an uploaded backdoor.
File name used by web shells
suspicious.shell_name
HighThe file name matches names commonly used by web shells and malware droppers.
Unusual PHP extension
suspicious.php_variant
MediumExtensions such as .phtml, .php5 or .phar are executable on many servers and are used to bypass upload filters.
PHP code inside an image
suspicious.php_in_image
CriticalThe image file contains PHP code. It may be included by another script to run a backdoor.

How to fix

The recommended action shown with each finding:

  • Double file extension, Hidden PHP file, .htaccess inside the directory, Hidden file, PHP file in an asset folder, File name used by web shells, Unusual PHP extension, PHP code inside an image
    Inspect the file. If you do not know why it is there, remove it, check other files changed at the same time and change your passwords.

Related settings

  • Settings → Targets: Themes to scan, Plugins to scan and Directories outside WordPress decide which files are checked. Each registered directory has its own Checks and exclusions.
  • Settings → Checks → Enabled checks: switch “Suspicious files” on or off.
  • Settings → Checks → Exclude patterns: files and folders that are not checked (by default node_modules, vendor, .git, .svn and cache).