Here’s a battle-tested list of prime target files to loot on a Linux web server, whether it’s running Apache, Nginx, PHP, Node.js, or Python.

These almost always contain database credentials, API keys, and even OS-level user creds.

FileWhy It Matters
config.phpPHP apps – MySQL creds, $db_user, $db_pass
.envLaravel, Node, Python – secrets, API tokens
wp-config.phpWordPress – DB creds, keys, salt values
configuration.phpJoomla – similar to wp-config
settings.pyDjango apps – secret keys, DB creds
config.js or .jsonNode apps – tokens, API keys
web.configASP.NET apps – may reveal DB creds
local.xmlMagento – often has DB creds in plain text

Commands:

find /var/www -name "*.php" -type f 2>/dev/null
find /var/www -name ".env" -type f 2>/dev/null
FileDescription
.htpasswdBasic Auth password file
.htaccessSometimes leaks internal paths or rewrites
.git/configRemote repo URL (internal repo = goldmine)
.ssh/id_rsaSSH private keys (check permissions)
.bash_historyCan contain curl, ssh, mysql creds
db_backup.sql or .sql.gzDumped DBs with creds and user data
secrets.yml, secrets.jsonApp secrets and keys

Commands:

find /var/www -type f -iname "*.sql" -o -iname "*.bak" -o -iname "*.env" 2>/dev/null
FileWhy It Matters
error.log / access.logLeaked requests, login attempts
debug.logStack traces, internal errors
development.logFound in Rails, Django, Laravel
phpinfo.php (if exposed)Reveals PHP modules, paths, etc.

Search for log files:

find /var/log -type f -iname "*.log" 2>/dev/null
cat wp-config.php | grep DB_
grep 'public $user' configuration.php
cat .env | grep APP_KEY
cat config.js | grep -i secret

Sysadmins love making backups… and forgetting them.

Look for:

FileExample
.bak, .old, .origwp-config.php.bak, index.php.old
.tar, .zip, .gzFull app folders or source dumps
copy_of_ or *_backupNaming tells you it’s a lazy backup

Search:

find /var/www -type f \( -iname "*.bak" -o -iname "*.zip" -o -iname "*.tar" \) 2>/dev/null

Sometimes web apps schedule cron jobs that you can tamper with.

Check:

ls -la /etc/cron* /var/spool/cron/

Look for scripts called by cron that are world- or group-writable.

TypeFile or Pattern
DB credsconfig.php, .env, wp-config.php, settings.py
Secrets & keys.env, secrets.yml, .git/config, .ssh/
Logsdebug.log, access.log, development.log
Backups*.bak, *.zip, *.tar.gz, .sql
ExecutablesAnything cron calls that’s writable
Shell history.bash_history, .mysql_history

Scroll to Top