Skip to content
goTool Español

Solutions · WordPress

WordPress: extra code inside the core (wp-includes/x.php)

With example names (mi-app, /ruta/al/proyecto). In GoTool, in 🛡 Security, this page shows your project's: your container, your compose file, your WordPress folder.

What's happening

/ruta/al/wordpress/wp-includes/x.php is inside wp-admin/ or wp-includes/ and isn't part of WordPress.

Why it matters

It's a typical place to hide a backdoor: nobody looks there.

What to do

  1. Keep a copy as it is, as evidence (without opening it in the browser):
    mkdir -p ~/gotool-pruebas && cp -a /ruta/al/wordpress/wp-includes/x.php ~/gotool-pruebas/
  2. See what else has changed in the core:
    wp core verify-checksums --path=/ruta/al/wordpress
  3. Delete it (it isn't part of WordPress: putting the core back doesn't remove it):
    rm /ruta/al/wordpress/wp-includes/x.php
  4. Put the whole core back, same version, without touching wp-content or wp-config.php:
    wp core download --force --skip-content --version=$(wp core version --path=/ruta/al/wordpress) --path=/ruta/al/wordpress
  5. Find out how they got in: plugins with known flaws, the administrators' passwords, and the rest of this project's critical issues in 🛡.
  6. If WordPress runs in a container, run the wp commands inside it: docker compose exec <service> wp …

How to know it's fixed

  • It must end in «Success» and say nothing about files that shouldn't be there:
    wp core verify-checksums --path=/ruta/al/wordpress
  • gotool checks the WordPress again on its next pass: once it's gone, it stops showing up.

If you can't do it that way

  • Without wp-cli: download the zip for your version from wordpress.org and copy wp-admin/, wp-includes/ and the root .php files over (not wp-config.php or wp-content/).

More

CWE-506 · MITRE ATT&CK T1505.003

In GoTool, the file with the issue (the Dockerfile, the compose file) is also shown with the solution next to it, and the question for Claude comes ready, with your project's details and without your keys, to paste into your claude.ai.

Ask us for a demo