Introduction
File and directory discovery (T1083) is a core reconnaissance technique. This post documents practical methods for enumerating filesystems, from passive information gathering to active command execution.
Method 1: Passive Information Gathering
1.1 Web Crawling and Sitemap Analysis
Objective: Identify publicly accessible files and directory structure
Tools:
curl/wget— Fetch pages and analyze linksrobots.txt— Check for directory hintssitemap.xml— Public directory mapping
Example:
# Fetch robots.txt for directory hints
curl -s https://target.com/robots.txt
# Parse sitemap for accessible paths
curl -s https://target.com/sitemap.xml | grep -oP '<loc>\K[^<]*'
Output: /admin/, /api/, /backup/, /uploads/