Reconnaissance · Part 02

Content Discovery in Web Pentesting: Tools, Commands & Examples

Learn how to discover website directories, files, historical URLs and API endpoints using Wayback Machine, gau, Katana, Gobuster and ffuf.

Content Discovery Web Reconnaissance URL Enumeration Directory Discovery VAPT
Getting Started

What Is Content Discovery?

Content discovery is the process of finding website pages, directories, files, URLs and API endpoints that may not be visible in the main navigation.

For example, a website may have a public homepage, but also contain a login page, API routes and old files.

Example Website Paths
https://example.com/login
https://example.com/admin
https://example.com/api/users
https://example.com/backup.zip

These are illustrative URLs, not confirmed resources on example.com.

Important: Only crawl or fuzz websites that you own or have permission to test. Archived URLs may refer to systems outside your scope.
Visual Explanation

How Content Discovery Works

Content discovery workflow An authorized website is examined using manual checks, historical URL sources, active crawling and wordlist discovery. Findings are then verified and documented. Target Website Authorized Scope Manual Discovery Links · robots.txt · sitemap.xml Historical URL Discovery Wayback Machine · gau Active Content Discovery Katana · Gobuster · ffuf Verify and Document Findings
Historical sources → Crawling → Wordlist discovery → Verification
Step 01

Manual Content Discovery

Start by checking website navigation, page source, links, robots.txt and sitemap.xml.

robots.txt

This file gives instructions to web crawlers. It may mention paths that are not linked from the homepage.

Bash · robots.txt
curl -s https://example.com/robots.txt
Illustrative Output
User-agent: *
Disallow: /private/
Disallow: /admin/

sitemap.xml

A sitemap lists URLs that a website wants search engines to discover.

Bash · sitemap.xml
curl -s https://example.com/sitemap.xml
Illustrative Output
<urlset>
  <url>
    <loc>https://example.com/about</loc>
  </url>
  <url>
    <loc>https://example.com/contact</loc>
  </url>
</urlset>
Remember: A path listed in robots.txt is not necessarily sensitive, and robots.txt does not provide access control.
Step 02

Wayback Machine — Historical URL Discovery

What is Wayback Machine? An Internet Archive service that stores historical snapshots of websites.

It can help you discover old pages, endpoints and URL structures.

Browser Method

Browser URL
https://web.archive.org/web/*/example.com/*

Terminal Method — CDX API

Bash · Archived URLs
curl -sG "https://web.archive.org/cdx/search/cdx" --data-urlencode "url=example.com/*" --data-urlencode "output=txt" --data-urlencode "fl=original" --data-urlencode "collapse=urlkey" | sort -u > wayback.txt
Illustrative Output
https://example.com/login
https://example.com/old-dashboard
https://example.com/api/v1/users

Archived URLs may be unavailable today. API access may also be rate-limited or unavailable.

Step 03

gau — Get All URLs

What is gau? A tool that collects known URLs from public sources such as Common Crawl, Wayback Machine and other configured providers.

Installation

Bash · Install gau
go install github.com/lc/gau/v2/cmd/gau@latest

If Go's binary directory is not in PATH, run the installed binary from ~/go/bin/gau.

Important Commands

Find known URLs

Bash · Basic gau
gau example.com

Save results

Bash · Save URLs
gau example.com --o gau.txt

Exclude common static file extensions

Bash · Filter Extensions
gau example.com --blacklist png,jpg,jpeg,gif,svg,woff,woff2
Illustrative Output
https://example.com/login
https://example.com/search?q=test
https://example.com/api/products
https://example.com/account/settings
FlagPurpose
--oSave URLs to a file
--blacklistExclude specified file extensions
--subsInclude subdomain URLs
--threadsControl concurrency
Step 04

Katana — Website Crawling

What is Katana? A web crawler that visits pages, follows links and discovers URLs and endpoints.

Installation

Bash · Install Katana
go install github.com/projectdiscovery/katana/cmd/katana@latest

Important Commands

Basic crawling

Bash · Katana
katana -u https://example.com

Crawl with depth and rate limit

Bash · Controlled Crawling
katana -u https://example.com -d 2 -rl 5 -silent -o katana.txt

Use a list of websites

Bash · Multiple Targets
katana -list live-urls.txt -d 2 -rl 5 -silent -o crawled.txt
Illustrative Output
https://example.com/
https://example.com/login
https://example.com/products
https://example.com/api/products
https://example.com/assets/app.js
FlagPurpose
-uStarting URL
-listFile containing starting URLs
-dMaximum crawl depth
-rlMaximum requests per second
-silentClean output
-oSave results
Crawling sends HTTP requests. Start with a low rate limit and check the tool's scope settings so it does not follow links to unrelated hosts.
Step 05

Gobuster DIR — Directory and File Discovery

What is Gobuster DIR? A tool that uses a wordlist to test possible directory and file paths on a website.

Installation

Bash · Install Gobuster
sudo apt update
sudo apt install gobuster

Important Commands

Basic directory discovery

Bash · Gobuster DIR
gobuster dir -u https://example.com -w /usr/share/wordlists/dirb/common.txt -t 5

Discover files with extensions

Bash · File Extensions
gobuster dir -u https://example.com -w /usr/share/wordlists/dirb/common.txt -x php,txt,html -t 5 -o gobuster.txt
Illustrative Output
/admin     (Status: 403)
/login     (Status: 200)
/images    (Status: 301)
/robots.txt (Status: 200)
FlagPurpose
dirDirectory and file discovery mode
-uTarget URL
-wWordlist path
-xFile extensions
-tNumber of concurrent threads
-oSave results
A 403 response usually means the server refused the request. It does not mean the directory is accessible.
Step 06

ffuf — Web Content Fuzzing

What is ffuf? A web fuzzing tool that replaces the FUZZ keyword with values from a wordlist.

It is useful for discovering paths, files and, when authorized, testing parameter names or values.

Installation

Bash · Install ffuf
sudo apt update
sudo apt install ffuf

Important Commands

Directory discovery

Bash · Directory Fuzzing
ffuf -u https://example.com/FUZZ -w /usr/share/wordlists/dirb/common.txt -rate 5

Filter 404 responses

Bash · Filter Results
ffuf -u https://example.com/FUZZ -w /usr/share/wordlists/dirb/common.txt -fc 404 -rate 5

Save results

Bash · Save JSON
ffuf -u https://example.com/FUZZ -w /usr/share/wordlists/dirb/common.txt -fc 404 -rate 5 -o ffuf.json -of json
Illustrative Output
admin  [Status: 403, Size: 275]
login  [Status: 200, Size: 1830]
images [Status: 301, Size: 310]
FlagPurpose
FUZZPlaceholder replaced with wordlist entries
-uTarget URL
-wWordlist path
-fcFilter specified status codes
-rateLimit requests per second
-oOutput filename
-ofOutput format
Some websites return 200 for missing pages. Check response sizes and content instead of relying only on HTTP status codes.
Practical Example

Content Discovery Workflow

Use this sequence on a website you own or have permission to test.

1. Collect Historical URLs

gau
gau thepentestlab.in --o gau.txt

2. Crawl the Website

Katana
katana -u https://thepentestlab.in -d 2 -rl 5 -silent -o katana.txt

3. Combine Discovered URLs

Combine Files
cat gau.txt katana.txt | sort -u > discovered-urls.txt

4. Discover Additional Paths

Gobuster
gobuster dir -u https://thepentestlab.in -w /usr/share/wordlists/dirb/common.txt -t 5 -o gobuster.txt

5. Fuzz Paths with ffuf

ffuf
ffuf -u https://thepentestlab.in/FUZZ -w /usr/share/wordlists/dirb/common.txt -rate 5 -fc 404 -o ffuf.json -of json

6. Review Results

Compare discovered URLs with the website's current pages. Check which resources exist, their response codes and whether they belong to your authorized scope.

Remember: A historical URL does not guarantee a live resource. A discovered path is not automatically a vulnerability.
Quick Revision

Content Discovery Tools Summary

Order Tool Main Purpose
1Manual checksLinks, robots.txt and sitemap.xml
2Wayback MachineHistorical URLs and snapshots
3gauKnown URLs from public sources
4KatanaActive website crawling
5Gobuster DIRDirectory and file discovery
6ffufWeb path and parameter fuzzing

Key takeaway: Historical URL collection helps find previously known content. Crawling follows existing links, while wordlist-based discovery tests paths that may not be linked anywhere.

Next Lesson: Service Enumeration

Learn how to identify open ports, running services and service versions using Nmap and other enumeration techniques.

Explore More Tutorials →