Review Webserver Metafiles for Information Leakage
High-Level Description
Web servers contain various metafiles that can inadvertently expose sensitive information about the application structure, hidden directories, restricted areas, and internal configurations. Files such as robots.txt, sitemap.xml, security.txt, and META tags are often overlooked but can provide attackers with valuable reconnaissance data. This test involves systematically reviewing these metafiles to identify information leakage and potential attack vectors.
What to Check
Metafiles to Examine
robots.txt - Spider/crawler directives
sitemap.xml - Site structure mapping
sitemap_index.xml - Sitemap index files
security.txt - Security policy disclosure
humans.txt - Team/contributor information
crossdomain.xml - Flash cross-domain policy
clientaccesspolicy.xml - Silverlight policy
.well-known/ directory contents
HTML META tags - Robot directives
Open Graph and Twitter Card metadata
ads.txt - Authorized digital sellers
app-ads.txt - Mobile app advertising
assetlinks.json - Android app links
apple-app-site-association - iOS app links
Information to Identify
Hidden or restricted directories
Administrative panels and login pages
API endpoints
Backup directories
Development/staging paths
Internal IP addresses
Technology stack indicators
Team member names and roles
Security contact information
PGP/GPG keys
How to Test
Step 1: Retrieve and Analyze robots.txt
# Download robots.txt
curl -s https://target.com/robots.txt
# Save to file
curl -s https://target.com/robots.txt -o robots.txt
# Check for multiple user-agent sections
curl -s https://target.com/robots.txt | grep -i "user-agent\|disallow\|allow\|sitemap"
# Find robots.txt via Google
site:target.com inurl:robots.txt
# Find sitemaps
site:target.com inurl:sitemap filetype:xml
# Find exposed directories from robots.txt
site:target.com inurl:admin OR inurl:backup OR inurl:config
Monitor for unauthorized access to "disallowed" paths
2. Sitemap Security
Exclude sensitive URLs from sitemaps
Keep sitemaps updated (remove deprecated pages)
Don't include internal/development URLs
Consider requiring authentication for full sitemaps
3. META Tag Hardening
<!-- Remove generator information --><!-- Bad --><metaname="generator"content="WordPress 6.0" /><!-- Good - Remove entirely or use generic --><metaname="generator"content="Custom CMS" /><!-- Restrict indexing for sensitive pages --><metaname="robots"content="noindex, nofollow" />
4. security.txt Guidelines (RFC 9116)
# Include useful information
Contact: mailto:security@example.com
Encryption: https://example.com/.well-known/pgp-key.txt
Policy: https://example.com/security-policy
Preferred-Languages: en
Expires: 2025-12-31T23:59:59.000Z
# Sign the file with PGP for authenticity