Step 0
Before you start
Update PHP first: 8.2.35, 8.3.36, 8.4.27, 8.5.12 or newer. If you scan before you patch, the site can be hit again while you work.
Download a full copy of the site files:
- cPanel: File Manager → select
public_html→ Compress → Zip → Download. - Plesk: Files → select the site folder → Archive → Download.
- Any host: SFTP with FileZilla, download the whole web folder.
- Managed host (WP Engine, Kinsta, SiteGround and others): download a backup from the dashboard.
- The database (posts, products, orders, users): hosting panel → phpMyAdmin → select the database → Export → Quick → SQL → Go. The scan needs only the files; keep the database export with them as your backup.
- cPanel: File Manager → select
Unzip it into a new, empty folder on your computer. Work on this copy only. Do not run any file from it.
Take out the file that holds your passwords before you give the folder to any AI:
WordPresswp-config.php· Drupalsites/default/settings.php· Joomlaconfiguration.php· Laravel.env· Magentoapp/etc/env.php.
Look at that file yourself. It should hold only database settings, keys and site options. Any eval, base64_decode, include of another file or long line of scrambled text is a sign of attack.Use an AI that can read a whole folder: Claude Code, Codex CLI or Gemini CLI, opened in the copy. A chat window that takes one file at a time misses things.
An AI scan finds most backdoors, but it is not proof that a site is clean. If it finds anything, follow "Already hit?" below.
Prompt 1 of 6 · start here
Any PHP site (start here)
Replace the highlighted [PLATFORM] and [VERSION] with your own before you paste it.
You are a web security analyst. This folder is a copy of my [PLATFORM] website, version [PLATFORM VERSION], downloaded today. The server ran PHP [PHP VERSION]. It may have been attacked through PHP2Shell (CVE-2026-109618, CVE-2026-109619). Attacks were seen from 17 October 2026 and the flaw was known to researchers from 1 August 2026. Read only. Do not change, delete or run any file in this folder. Put any notes or downloads outside it. 0. First compare every file with the official published checksums for this exact version of [PLATFORM] and of each plugin, theme or package, and treat a file that matches as official. Find: 1. PHP files in folders that should only hold uploads, images, cache or temp files. 2. Hidden or scrambled code: eval, assert, base64_decode, gzinflate, gzuncompress, str_rot13, strrev, hex or char-code strings, preg_replace with /e, create_function, very long single lines of encoded text. 3. Code that runs system commands: system, exec, shell_exec, passthru, proc_open, popen, pcntl_exec, backticks. 4. Code that takes input from $_GET, $_POST, $_COOKIE, $_REQUEST, $_FILES or php://input and passes it to anything in 2 or 3, or writes it to a file. 5. Files changed on or after 1 August 2026, and files with names that imitate real files (wp-1ogin.php, index.php.bak, .cache.php). 6. Changes in .htaccess, .user.ini, php.ini, and any auto_prepend_file or auto_append_file setting. 7. Code that creates admin users, sends data to outside URLs, or adds scheduled tasks. For each finding give: file path, line number, what the code does in plain English, risk (high, medium, low), and whether it is part of the official [PLATFORM] release. End with: a list of files to delete, a list of files to replace with a fresh official copy, and what you could not check.
Prompt 2 of 6
WordPress
Run Prompt 1 with PLATFORM = WordPress, then:
Now check what is special to WordPress in this folder: 1. Compare wp-admin and wp-includes with the official WordPress release of the same version. List every file that is added or different. 2. List every .php file inside wp-content/uploads. There should be none. 3. List everything in wp-content/mu-plugins. Explain what each file does. Attackers like this folder because these plugins cannot be turned off in the dashboard. 4. List every plugin and theme folder, with its version. Mark any I may not know about, any not on wordpress.org, and any with a known security problem. 5. Read functions.php and header.php of every theme for code that loads remote scripts or hides admin users. 6. Check for drop-in files: wp-content/db.php, object-cache.php, advanced-cache.php, sunrise.php. Say if each one belongs to a plugin I have.
If you have WP-CLI on the server, these two commands do the core and plugin comparison for you: wp core verify-checksums and wp plugin verify-checksums --all.
wp core verify-checksums wp plugin verify-checksums --all
In the dashboard: Users → filter "Administrator". Delete any admin you do not know.
Prompt 3 of 6
WooCommerce (add to Prompt 2)
This WordPress site runs WooCommerce and takes payments. Also check: 1. Any JavaScript added to the checkout or cart pages, in theme files, plugin files or inline, that reads card fields or sends form data to a domain that is not my payment provider ([PROVIDER], e.g. Stripe or PayPal). 2. Any change in the payment gateway plugin files compared to the official release. 3. Code that copies orders, customer emails or addresses to a file or an outside URL.
A file scan cannot see scripts saved in the database (widgets, page builders, header and footer plugins). Open your live checkout page, and check that card details go only to your payment provider.
If you take cards on your own page, tell your payment provider today, even before the scan ends.
Prompt 4 of 6
Drupal
Run Prompt 1 with PLATFORM = Drupal, then:
Now check what is special to Drupal: 1. Compare core/ and vendor/ with the official Drupal release of the same version and composer.lock. List every file that is added or different. 2. List every .php file inside sites/*/files. There should be none. Check that sites/default/files/.htaccess still blocks PHP. 3. List every module and theme in modules/ and themes/, with its version. Mark any that are not on drupal.org. 4. Look for code that adds a user with the administrator role or changes user 1.
On the server: drush pm:security lists modules with known security problems.
drush pm:security
In the admin: People → filter role "Administrator".
Prompt 5 of 6
Joomla
Run Prompt 1 with PLATFORM = Joomla, then:
Now check what is special to Joomla: 1. Compare the folders administrator, components, includes, libraries, modules and plugins with the official Joomla release of the same version. List every file that is added or different. 2. List every .php file inside images, media, tmp and cache. There should be none. 3. Read index.php of every template in templates/ for remote scripts or hidden code. 4. List every extension folder, with its version. Mark any that are not in the Joomla Extensions Directory.
In the admin: Users → filter group "Super Users". Remove any you do not know.
Prompt 6 of 6
Laravel or custom PHP
Run Prompt 1 with PLATFORM = Laravel (or "custom PHP"), then:
Now check what is special to this app: 1. List every .php file in public/ other than index.php, and every .php file in storage/. 2. Compare vendor/ with composer.lock. List packages that are not in composer.lock or files that differ from the published package. 3. List every route in routes/ and every controller. Mark any route that runs commands, uploads files, or has no login check. 4. Check bootstrap/, config/ and app/Providers for code that loads on every request and was changed on or after 1 August 2026.
On the server: composer audit lists packages with known security problems.
composer audit
No PHP server
Wix, Squarespace, Shopify, Webflow
You have no PHP server to patch or files to download. The platform patches for you. Change your password and turn on two step login.
If you were hit
Already hit? Get back online
Put up a maintenance page, or take the site offline (NSA advice).
Save a copy of the hacked files and the server logs before you change anything. You or an expert may need them.
Update PHP to a patched version. If you skip this, the site gets hit again.
Rebuild clean. Best: a fresh install of the core, plus plugins, themes and extensions downloaded again from the official source. Then copy back only your own content (images, documents, database), with no PHP files in it. Or restore a backup made before 17 October 2026, then scan it with the prompts above before it goes live.
Change every password and key, from a clean computer: hosting, SFTP, database, every admin user, API keys, payment keys, and the WordPress salts in wp-config.php.
Remove admin users you do not know. Check the server's scheduled tasks (cPanel: Cron Jobs) and delete any you did not make.
Scan again. When nothing is found, go back online.
If Google shows a warning on your site: Search Console → Security issues → Request review.
If customer data or payments were on the site, tell your payment provider, and check the law where you are. In the EU and UK you have 72 hours to report a personal data breach.
Watch the logs for two weeks. If you are not sure the site is clean, use an incident response company.
Sources
Sophos advisory sophos-sa-20261021-php2shell (attempts seen since 17 Oct 2026; review from 1 Aug 2026), ReliaQuest (patching does not remove web shells or accounts), Armis (preserve evidence first), Safeguard (rotate secrets, rebuild hosts with signs of compromise; NCSC: use an assured incident response provider if unsure).