ScanTitan provides a PHP malware scanner that reads the PHP files on your server and flags web shells, backdoors, obfuscated code and injected includes. You connect from the ScanTitan portal over read-only SFTP or SSH, so nothing is installed and no file is changed. The report gives a verdict for each file, with the file path and line of every suspicious pattern. Your first scan is free with an account, and further scans need a paid plan.
Create an account, connect a read-only SFTP or SSH account, and run your first scan free. Nothing is installed and no file is changed.
A PHP malware scanner is a tool that reads PHP source code and flags the code attackers plant: web shells, backdoors, loaders that download more code, obfuscated eval chains and mailer scripts. Three kinds exist. A command line scanner such as PHP Antimalware Scanner or php-malware-finder runs on your server and needs shell access. An online URL scanner requests your pages from outside and never sees PHP source. A portal scan connects to the server and reads the files without installing anything.
ScanTitan provides the third kind. You connect from the portal over read-only SFTP or SSH, the scan reads the PHP files in your web root, and the report gives a verdict for each file, the file path and the line of every suspicious pattern. A flag is a lead to confirm, not a sentence, because legitimate frameworks also use functions such as eval and base64_decode.
To scan PHP files for malware with ScanTitan, create an account, add your site in the portal and connect with a read-only SFTP or SSH account limited to the web root. ScanTitan reads the PHP files, matches them against web shell, backdoor and obfuscation patterns, and returns a verdict for each file with its path and line. Run the first scan before you delete anything, because that report is your evidence.
Add your site
Create an account and add the site in the portal. Confirm that you own it or have permission to scan it.
Connect read-only
Give ScanTitan a read-only SFTP or SSH account limited to the web root. Create a dedicated account and delete it after the scan.
Read the PHP files
ScanTitan lists the files and reads the PHP source. It does not run your code and it writes nothing to the server.
Match known patterns
Compares the code with web shell, backdoor, loader and obfuscation patterns, including eval chains and remote includes.
Give a verdict per file
Marks every file clean, suspicious or malicious and explains the reason in plain words.
Report path and line
Lists the file path and the line of each suspicious pattern, so you can open the exact spot.
On a suspect server, the first report is your evidence. The rescan after the cleanup is compared against it, so you can prove each finding is gone.
A PHP malware scan gives every file one of three verdicts: clean, suspicious or malicious. A malicious verdict means the code does something an attacker wants, such as running a command sent by a visitor. A suspicious verdict means the code uses a risky function in a way you should confirm, such as eval on a decoded string. A clean verdict means no known pattern matched in that file.
Treat malicious and suspicious findings as leads. Open the file at the reported line, ask whether you or a developer wrote it, and compare it with the official copy of the plugin or package. Keep a copy of the file before you delete it, because the evidence helps you find how it arrived.
To clean an infected PHP server, remove the malicious files, close the way in and rescan. ScanTitan finds and verifies, while you, your host or a security professional do the cleaning, and our website malware removal guide gives the steps. Removing the shell is only half the job: update the software that let the attacker in and change SFTP, database and admin credentials, or the file comes back.
After the cleanup, run the scan again. A rescan is another scan, so it counts toward your plan, and a clean result means the files that were read matched no known pattern, not that the server is safe forever. If a file keeps returning, read how to find a backdoor in a website.
A PHP malware scan looks for six kinds of pattern in every PHP file, and each finding in the report is explained in plain words. The numbers on the example file match the cards.
Commands from the request
system, exec, shell_exec, passthru and popen fed by $_POST, $_GET or $_REQUEST: the core of a web shell.
Eval of decoded strings
eval or assert running the output of base64_decode, gzinflate or str_rot13, which hides the real code.
Obfuscation chains
Layered encodings, variable names built from character codes and strings assembled at run time to defeat simple searches.
Remote includes and downloaders
include or require of a URL, and code that fetches a second stage with file_get_contents or curl.
File writers and droppers
Code that writes new PHP files, web shells or .htaccess rules into the web root.
Mailer and spam scripts
Loops that send mail or serve doorway pages, a common reason hosts suspend an account.
Malicious PHP code usually combines a function that runs something with a trick that hides what it runs. A single eval line can give an attacker a remote shell, and a long line of encoded text is the usual giveaway. The table lists the patterns scanners flag first, why attackers use them and where legitimate code uses them too, which is why every flag needs a human check.
| Pattern | Why attackers use it | Legitimate use | What to check |
|---|---|---|---|
eval() | Runs text as code, so a payload can hide inside a string | Rare: some template engines and old plugins | Is the string decoded, or taken from the request? |
base64_decode() with gzinflate() | Hides the real code from searches | Encoding data, tokens and small assets | Is the result passed to eval or include? |
system(), exec(), shell_exec(), passthru() | Runs commands on the server | Admin tools, backups, image processing | Does the command come from $_POST or $_GET? |
assert() and preg_replace with /e | Old ways to run code from a string | Almost none in modern code, and PHP 7 and 8 removed them | Any use is a lead worth opening |
include or require of a URL | Loads a second stage from the attacker | allow_url_include is off by default | Is it on, and why? |
file_put_contents() writing .php | Drops new shells and loaders | Caches, generators and installers | Does it write PHP into the web root? |
call_user_func() with request data | Calls any function the attacker names | Callbacks with fixed names | Does the function name come from the request? |
Frameworks and Composer packages use some of these functions, so compare a flagged file with the official release before you act. Deeper guides: obfuscated PHP malware and what a web shell is. To read one file yourself, paste it into the malware code analyzer.
PHP malware hides in places owners rarely open: the uploads folder, helper files in includes, cache and temp folders, vendor packages, .htaccess and .user.ini, configuration files and scheduled tasks. The scan reports the file path and line when it finds a pattern. The table shows how to check each place by hand when a finding points at a file, or when the scan is clean and the symptoms continue.
| Location | What attackers hide there | How to check it by hand |
|---|---|---|
uploads/ | PHP shells posing as images | Run find uploads -name "*.php". No PHP belongs in an uploads folder. |
includes/ and lib/ | Loader lines added to legitimate helper files | Compare with a clean backup or your repository and sort by modification date. |
cache/ and tmp/ | Droppers, temporary copies and a rogue PHP process | List PHP files changed recently and check running processes for PHP you do not recognise. |
vendor/ | Tampered Composer packages | Reinstall from the lock file and compare the result with what is on the server. |
.htaccess and .user.ini | auto_prepend_file that loads malware before every script, and redirects | Read both files and remove lines you cannot explain. |
| Configuration files | An injected include after the database settings | Read the file by hand and look for code after the credentials block. |
| Document root | Fake files with real sounding names such as wp-feed.php | List PHP files by newest modification date and open any you did not add. |
| Scheduled tasks | A cron job that recreates the shell after you delete it | Run crontab -l and read the schedule in your hosting panel. |
Replace files with official copies of your CMS, plugins and packages wherever you can instead of editing them by hand. Related guides: .htaccess malware and finding a backdoor.
| Type | What it does | Where it sits | Tell-tale sign |
|---|---|---|---|
| Web shell | A remote file manager or command prompt in a browser | Uploads, themes, includes | The file accepts a password or command parameter |
| Dropper or loader | A small file that downloads or writes the shell | Cache, tmp, uploads | A tiny file that includes or fetches a URL |
| Backdoor | Hidden re-entry that survives a password change | Fake core files, plugins, includes | Code that runs only when a secret cookie or parameter is present |
| SEO spam doorway | Serves spam pages to search crawlers only | Document root, odd subfolders | Pages in Google that visitors never see |
| Mailer | Sends spam from your server | Any writable folder | Outbound mail spikes and a host abuse notice |
| Redirector | Sends some visitors to scam pages | index.php, .htaccess | A redirect only on a first visit or on mobile |
Your PHP site probably has malware if PHP files appear that nobody added, deleted files come back, outbound mail spikes, your host sends an abuse notice, or visitors are redirected. The quietest infections show no symptom at all, so scan rather than wait. See 12 signs of website malware for what each one means.
PHP files you did not add
The newest files in uploads, cache or the document root are the first place to look.
Files that return after deletion
A rogue process, a cron job or a second backdoor recreates them.
Outbound mail spikes
A mailer script is sending spam from your server.
Host abuse or suspension notice
Your provider has seen spam or malware coming from your account.
Redirects or spam in Google
Visitors land on scam pages, or pharma and gambling pages appear under your domain.
Unknown admin users
New administrators, or passwords that changed without you.
Wrong permissions
Folders set to 777, or files writable by the web server that should not be.
High CPU or slow pages
Spam loops and hidden miners use resources.
A clean result means the scanned PHP files matched no known pattern. A hidden PHP process in memory or in the tmp folder can rewrite a file after you delete it, a cron job can recreate it, and the code may sit in the database or in a folder outside the path you connected. Check running processes and scheduled tasks, scan the other folders, and read why a scanner can say clean while the site is still infected.
A server file scan reads your PHP files over SFTP or SSH, a command line scanner such as PHP Antimalware Scanner, php-malware-finder or ClamAV does the same on the server itself, and an online URL scanner sees only what visitors receive. Each sees a different part of the problem, and no single kind sees everything, so combine two.
| What it does | ScanTitan portal scan | Command line scanner | Online URL scanner |
|---|---|---|---|
| Reads the PHP source files | ✓ | ✓ | ✗ |
| Needs shell access and commands | No | Yes | No |
| Install anything on the server | No | Yes | No |
| Report with file path and line | ✓ | ✓ | ✗ |
| Finds a shell that no public page reveals | ✓ | ✓ | ✗ |
| Sees redirects that only some visitors get | ✗ | ✗ | ✓ |
| Needs your server login | Read-only | Yes | No |
| Cost | One free scan | Free, open source | Free basic check |
Finds what is in your PHP files now: web shells, backdoors, loaders and obfuscated code. It tells you the files are infected and where.
Finds the weakness that let the attacker in, such as an end of life PHP version or a published CVE. See the PHP vulnerability scanner. To read a single suspicious file, use the malware code analyzer.
A ScanTitan PHP malware report is a list of verdicts with the file path and line, not a score. Keep the first report, because the rescan after your cleanup is the proof that a finding is gone.
Illustrative example with a reserved example.test name. Not a real scan.
To stop PHP malware coming back, close the way in, because it returns when that stays open. Most shells arrive through an upload form, an outdated plugin or library, or a stolen SFTP password, so closing those matters more than deleting the file. Scan uploads as they arrive with a library such as phpMussel or an upload scanning service, and use the steps below after every cleanup.
<FilesMatch "\.(php|phtml|phar)$"> Require all denied </FilesMatch>
location ~* ^/uploads/.*\.(php|phtml|phar)$ {
deny all;
}Test on a staging copy first. PHP-FPM and hosting panels differ.Scan PHP files for malware when a symptom appears and at the moments an infection is most likely or most costly to miss. A clean scan is a snapshot of one day, because new flaws appear daily and attackers reinfect cleaned servers.
Scan before you change anything
Right away. When you see an abuse notice, spam or an unknown PHP file, scan first so the evidence stays intact.
Scan after every deploy or update
After changes. New code is the usual way malware arrives, especially from outside the official package source.
Scan after a restore or host move
After a move. A restored backup can bring an old infection back with it. Scan before you point visitors at the new server.
Rescan to confirm the files are gone
After cleanup. Compare the rescan with the first report, and watch for the same file returning.
These answers cover PHP malware scanning, server access, limits and cleanup in a few sentences each.
ScanTitan's PHP malware scanner is right for you if you want to know which PHP files are malicious without running tools in a shell, and it is not the right tool if you need cleanup done for you.
Create an account, connect a read-only SFTP or SSH account and run your first scan free. ScanTitan finds and verifies. You or your host do the cleaning.
Reviewed by Obaida Al-Sulaiman, Information Security Manager
One scan finds the infection and a second shows how it got in. Pick the tool that matches where you are.