Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Review Old Backup and Unreferenced Files for Sensitive Information
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 267% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 213% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 302% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 116% | 0% |
| case-11 | ✓→✓ | = Same ✓ | 157% | 0% |
WSTG-CONF-04
Review Old Backup and Unreferenced Files for Sensitive Information
Old backup files, unreferenced pages, and forgotten content can expose sensitive information including source code, credentials, and outdated vulnerable functionality. These files often contain debugging information, database credentials, or reveal application logic that aids attackers. This test focuses on discovering such files through inference, brute-forcing, and examining publicly available information.
| Pattern | Description | | ------------- | ----------------- | | file~ | Emacs backup | | file.bak | Generic backup | | file.old | Old version | | file.orig | Original version | | file.save | Saved version | | file.swp | Vim swap file | | file.tmp | Temporary file | | Copy of file | Manual copy | | file (1).ext | Duplicate | | file_backup | Backup naming | | file_YYYYMMDD | Date-based backup |
bash# If you find viewuser.asp, try: files=("edituser.asp" "adduser.asp" "deleteuser.asp" "listuser.asp" "createuser.asp" "updateuser.asp" "modifyuser.asp" "removeuser.asp") for file in "${files[@]}"; do status=$(curl -s -o /dev/null -w "%{http_code}" "https://target.com/$file") echo "$file: $status" done
bash#!/bin/bash TARGET=$1 FILE=$2 # e.g., config.php # Backup extensions extensions=( ".bak" ".backup" ".old" ".orig" ".save" ".swp" ".tmp" ".copy" ".1" ".2" "~" "_backup" "_old" "_bak" ".txt" ".src" ".inc" ".dev" ".test" "-backup" "-old" "-copy" ".BACKUP" ".BAK" ) for ext in "${extensions[@]}"; do test_file="${FILE}${ext}" status=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET/$test_file") if [ "$status" == "200" ]; then echo "[FOUND] $test_file" fi done # Also test prefix patterns prefixes=("backup_" "old_" "copy_" "bak_" "." "_") for prefix in "${prefixes[@]}"; do test_file="${prefix}${FILE}" status=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET/$test_file") if [ "$status" == "200" ]; then echo "[FOUND] $test_file" fi done
bash# Common archive files archives=( "backup.zip" "backup.tar.gz" "backup.tar" "backup.rar" "site.zip" "www.zip" "html.zip" "web.zip" "database.sql" "db.sql" "dump.sql" "backup.sql" "files.zip" "archive.zip" "old.zip" ) for file in "${archives[@]}"; do status=$(curl -s -o /dev/null -w "%{http_code}" "https://target.com/$file") if [ "$status" == "200" ]; then echo "[CRITICAL] Archive found: $file" fi done # Date-based backups for year in 2023 2024 2025; do for month in 01 02 03 04 05 06 07 08 09 10 11 12; do file="backup_${year}${month}.zip" status=$(curl -s -o /dev/null -w "%{http_code}" "https://target.com/$file") if [ "$status" == "200" ]; then echo "[FOUND] $file" fi done done
bash# Look in HTML source for hidden links curl -s https://target.com | grep -oP 'href="[^"]*"' | sort -u # Look for commented code curl -s https://target.com | grep -oP '<!--.*?-->' # Look in JavaScript curl -s https://target.com | grep -oP 'src="[^"]*\.js[^"]*"' | while read js; do curl -s "https://target.com$js" | grep -iE 'admin|backup|test|dev|hidden' done
bash# Check robots.txt for hidden paths curl -s https://target.com/robots.txt # Test disallowed paths curl -s https://target.com/robots.txt | grep "Disallow" | awk '{print $2}' | while read path; do status=$(curl -s -o /dev/null -w "%{http_code}" "https://target.com$path") echo "$path: $status" done
# Google dorks for backups
site:target.com filetype:bak
site:target.com filetype:sql
site:target.com filetype:zip
site:target.com filetype:tar
site:target.com filetype:old
site:target.com "index of" backup
site:target.com inurl:backup
site:target.com intitle:"index of" "backup"bash# Gobuster gobuster dir -u https://target.com \ -w /usr/share/seclists/Discovery/Web-Content/common.txt \ -x bak,old,backup,zip,tar,gz,sql,tmp \ -o backup_scan.txt # ffuf ffuf -u https://target.com/FUZZ \ -w /usr/share/seclists/Discovery/Web-Content/backup-filenames.txt \ -mc 200
bash# Common snapshot paths snapshots=( "/.snapshot/" "/.snap/" "/~snapshot/" "/backup/" "/backups/" "/old/" "/archive/" "/archived/" ) for path in "${snapshots[@]}"; do status=$(curl -s -o /dev/null -w "%{http_code}" "https://target.com$path") if [ "$status" != "404" ]; then echo "Potential snapshot: $path - Status: $status" fi done
| Tool | Description | Usage | | ------------- | --------------------- | -------------------------------------------- | | Gobuster | Directory brute-force | gobuster dir -u url -w wordlist -x bak,old | | ffuf | Fast fuzzer | ffuf -u url/FUZZ -w wordlist | | Dirb | Directory scanner | dirb https://target.com | | Dirsearch | Web path scanner | dirsearch -u target.com |
| Tool | Description | | --------------- | ------------------ | | wget | Recursive download | | HTTrack | Website copier | | Burp Spider | Web crawler |
| Tool | Description | | ---------- | ---------------------- | | Nikto | Web server scanner | | Nessus | Vulnerability scanner | | Nuclei | Template-based scanner |
bash#!/bin/bash TARGET=$1 echo "=== BACKUP FILE SCANNER ===" echo "Target: $TARGET" # Wordlist of common backup files backup_files=( "backup.zip" "backup.tar.gz" "backup.sql" "database.sql" "site.zip" "www.zip" "html.zip" "web.zip" "db_backup.sql" "dump.sql" "data.sql" "config.php.bak" "wp-config.php.bak" ".htaccess.bak" "web.config.bak" "config.yml.bak" ) # Test each file for file in "${backup_files[@]}"; do status=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET/$file") if [ "$status" == "200" ]; then size=$(curl -sI "https://$TARGET/$file" | grep -i content-length | awk '{print $2}' | tr -d '\r') echo "[CRITICAL] Found: $file (Size: $size bytes)" fi done # Test common directories with date patterns echo "" echo "[+] Testing date-based backups..." current_year=$(date +%Y) for year in $((current_year-1)) $current_year; do for month in {01..12}; do for ext in zip tar.gz sql; do file="backup-${year}-${month}.$ext" status=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET/$file") if [ "$status" == "200" ]; then echo "[FOUND] $file" fi done done done echo "[+] Scan complete"
bash# Run backup-related templates nuclei -u https://target.com -t http/exposures/backups/ nuclei -u https://target.com -t http/exposures/files/
bash# Find and remove backup files find /var/www/html -name "*.bak" -delete find /var/www/html -name "*.backup" -delete find /var/www/html -name "*.old" -delete find /var/www/html -name "*~" -delete find /var/www/html -name "*.swp" -delete find /var/www/html -name "*.tmp" -delete # Find archives find /var/www/html -name "*.zip" -o -name "*.tar*" -o -name "*.sql"
apache# Apache <FilesMatch "\.(bak|backup|old|orig|save|swp|tmp|sql|tar|gz|zip|rar)$"> Require all denied </FilesMatch>
nginx# Nginx location ~* \.(bak|backup|old|orig|save|swp|tmp|sql|tar|gz|zip|rar)$ { deny all; return 404; }
| Finding | CVSS | Severity | | ---------------------------- | -------- | -------- | | Source code backup exposed | 7.5 | High | | Database dump accessible | 9.8 | Critical | | Config file with credentials | 9.8 | Critical | | Old vulnerable page | Variable | Variable |
Typical Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
| CWE ID | Title | Description | | ----------- | ------------------------------ | ------------------------------ | | CWE-530 | Exposure of Backup File | Backup accessible to attackers | | CWE-538 | Sensitive Information in Files | Sensitive data in public files | | CWE-200 | Information Exposure | Information disclosure |
[ ] Backup extension scanning completed
[ ] Archive files checked (.zip, .tar, .sql)
[ ] Date-based backup patterns tested
[ ] Robots.txt paths tested
[ ] Search engine dorking performed
[ ] Source code reviewed for hidden links
[ ] Snapshot directories checked
[ ] Directory brute-forcing completed
[ ] Unreferenced pages identified
[ ] Sensitive files documented
[ ] Risk assessment completedOther measured skills in the registry, with their headline benchmark lift.