Script http-config-backup

Script types: portrule
Categories: auth, intrusive

Script Summary

Checks for backups and swap files of common content management system and web server configuration files.

When web server files are edited in place, the text editor can leave backup or swap files in a place where the web server can serve them. The script checks for these files:

  • wp-config.php: WordPress
  • config.php: phpBB, ExpressionEngine
  • configuration.php: Joomla
  • LocalSettings.php: MediaWiki
  • /mediawiki/LocalSettings.php: MediaWiki
  • mt-config.cgi: Movable Type
  • mt-static/mt-config.cgi: Movable Type
  • settings.php: Drupal
  • .htaccess: Apache

And for each of these file applies the following transformations (using config.php as an example):

  • config.bak: Generic backup.
  • config.php.bak: Generic backup.
  • config.php~: Vim, Gedit.
  • #config.php#: Emacs.
  • config copy.php: Mac OS copy.
  • Copy of config.php: Windows copy.
  • GNU Nano.
  • .config.php.swp: Vim swap.
  • config.php.swp: Vim swap.
  • config.php.old: Generic backup.

This script is inspired by the CMSploit program by Feross Aboukhadijeh:

Script Arguments

directory to save all the valid config files found


the path where the CMS is installed


See the documentation for the slaxml library.

smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername

See the documentation for the smbauth library., http.max-body-size, http.max-cache-size, http.max-pipeline, http.pipeline, http.truncated-ok, http.useragent

See the documentation for the http library.

Example Usage

nmap --script=http-config-backup <target>

Script Output

80/tcp open  http    syn-ack
| http-config-backup:
|   /%23wp-config.php%23 HTTP/1.1 200 OK
|_  /config.php~ HTTP/1.1 200 OK



  • Riccardo Cecolin

License: Same as Nmap--See