helban.dev

Backup Scanner for WordPress

Someone sent you a backup of their WordPress site and wants it running on your machine? Drop it here first. The file is read in this browser tab and is not uploaded anywhere.

The example is put together in your browser from harmless bytes. It has the shape of the fake backup from November that this scanner was written after.

What the scanner checks

It reads a backup of a whole site in a zip, .tar or .tar.gz file, such as a WP Migrate export or the archive a hosting panel makes. A database dump (.sql or .sql.gz) can be dropped on its own too. It unpacks nothing to disk and runs nothing.

  • The first bytes of every file. A program posing as a photo starts differently from a JPEG, whatever its name says.
  • Media files from start to end, because a program or a zip can be glued behind a real picture.
  • Core and plugins from wordpress.org, file by file, against the official checksums.
  • The code that WordPress loads by itself: wp-config.php, .maintenance, mu-plugins, drop-ins and language files. There it looks for anything that starts a program, for hidden code and for new administrator accounts.
  • .htaccess, .user.ini and php.ini. XAMPP obeys them, and one line can turn a picture into a program.
  • The database dump: code run straight from the database, snippets, and active plugins whose files are missing.
  • Zips, tars and .tar.gz files lying inside the copy, one level deep.
  • Known vulnerabilities in the versions of core, plugins and themes.

What the scanner cannot see

A result with no findings does not mean the copy is clean. The scanner lists what it did not check in your copy. Some things it never checks at all.

  • Premium plugins, custom themes and mu-plugins have nothing official to be compared with. Rules judge them, and a rule can be wrong in both directions.
  • Themes from wordpress.org are not compared with their originals yet.
  • 7z and RAR archives are not opened, and neither are .wpress files. A zip inside a zip inside the copy stays closed. All of these are listed as not checked.
  • A tar written in a form that tar programs read in different ways gets a red finding, and its list may miss files that one of them writes. Honest archives with sparse files land there too: unpack such a copy and pack it again as a zip.
  • A payload that is encrypted or packed inside another file cannot be told by its bytes.
  • In the database it does not yet check administrator accounts or cron jobs. It finds code hidden in database rows only when that code is base64 and decodes to a program, PHP code or an archive.

If you run somebody's copy anyway, do it in a Linux container, not on Windows with XAMPP or LocalWP.

What leaves your browser

The file stays with you. The code that reads it runs in a separate browser thread that is denied every network connection. The browser itself enforces that, so you do not have to take my word for it.

The page itself may talk to three hosts only: api.wordpress.org, downloads.wordpress.org and www.wpvulnerability.net. They get the WordPress version and language, the names and versions of plugins, and the names of themes. Every request shows up in the log. These services also see your IP address, like any site you open. Uncheck the box under the drop area and the scan runs without the network. More files are then judged by rules alone.

Nothing from the file is stored, in the browser or on a server. There are no analytics scripts here. The page remembers one thing in this tab, where you came from, in case you write through the contact form later. The privacy policy describes it.

The scanner's code is public under GPLv3: github.com/Helban/backup-scanner-for-wordpress. The script verify_live.py in that repository compares the files this page serves with the published code.

Where the scanner comes from

In November someone posing as a client sent me a copy of a site to set up locally. In uploads sat a password stealer named like a photo, and a mu-plugin was there to start it on the first page view. I wrote it up in Malware in a WordPress backup, disguised as a photo. The scanner does what I did by hand and with my own script back then.

Found a copy the scanner let through? Write to me with the SHA-256 and a description. Do not send the file itself.