COMP-221 · Lesson 8 of 12 · 20 min

Web application enumeration

▶ Video coming soon A video version of this lesson is on the way.

Priyanka Haldane had a rule for web testing that she repeated to every junior: you cannot test what you have not mapped. On Monday, October 19, she sat Tobias next to her for the first day of the member portal staging test and spent the whole morning without sending a single attack. They mapped. By the afternoon they had a site map of 214 endpoints, three user roles, an API description the developers had forgotten to remove, and a second way into the application that bypassed its web application firewall.

This lesson covers objective 2.2's directory enumeration, web crawling, web application firewall enumeration including the origin address, and manual enumeration of robots.txt, sitemaps and platform plugins, along with objective 2.1's HTML scraping and information disclosure. Testing the application for vulnerabilities belongs to COMP-222 and COMP-223; this lesson is about building the map those courses use.

The target and its rules

The scope covered the staging environment of Prairiefold's member portal, staging-portal.prairiefold.example, hosted by the credit union at 203.0.113.30. Production online banking, run by the processor, was excluded. The rules of engagement added web-specific conditions: staging held only synthetic member data, automated tools had to stay below a request rate agreed with the development team, nothing could be deleted, and Priyanka was given two test accounts, one ordinary member and one branch staff user, to map authenticated areas.

The staging portal in a box on the left with arrows to five activities: crawl through a proxy (links, forms, parameters, API calls); robots.txt and sitemap (paths the owner listed); directory and file brute force, scoped (unlinked admin, backup and test paths); technology fingerprint (framework, CMS, plugins, versions); WAF and CDN detection (which layer answers, origin exposure). An arrow labeled combine into points to a site map of endpoints, roles and inputs.
Web application enumeration combines several techniques into one site map.

Intercepting proxies

Web testers work through an intercepting proxy: a tool that sits between the browser and the application and records every request and response, letting the tester inspect, replay and modify them. Burp Suite is the most widely used; the open-source ZAP (Zed Attack Proxy, originally an OWASP project) does similar work. Every page Priyanka visited, every form she submitted and every background API call the browser made appeared in the proxy history, building the site map automatically.

Browsing the application by hand through the proxy is the first and most important crawling step. A person understands what a page is for, can log in, can complete multi-step processes like opening an account, and notices things a tool does not. Priyanka logged in as each test user in turn and used every feature, so the proxy captured the requests behind them.

Web crawling

A crawler or spider follows links and submits forms automatically to discover content. Burp Suite and ZAP both include crawlers, and modern ones can drive a real browser engine to run JavaScript, which matters because single-page applications build their navigation in the browser and simple crawlers see almost nothing. Crawling must be scoped carefully: a crawler that follows a link to the processor's online banking site would be testing an out-of-scope system, and a crawler logged in as a user may click logout, delete or submit buttons. Priyanka configured the scope in Burp to staging-portal.prairiefold.example only and excluded logout and destructive actions.

What crawling contributes to the map.
What the crawl foundWhy it matters
Pages and formsInputs that later tests will examine
API endpoints called by the front endOften the real attack surface in modern applications
Parameters and their valuesIdentifiers that may allow access to other users' data
JavaScript filesMay contain additional endpoints, comments and configuration
Links to other hostsThird parties, content delivery networks and out-of-scope systems to record

Manual enumeration: robots.txt, sitemaps and friends

Some files exist specifically to describe a site, and reading them is quick and low impact.

robots.txt tells search engine crawlers which paths not to index. It is a request to well-behaved crawlers, not an access control, and it often lists exactly the paths an organization would rather people did not find. Staging's robots.txt disallowed /admin/, /reports/ and /api/v1/internal/.

sitemap.xml lists pages the owner wants indexed and sometimes includes forgotten ones. Staging's sitemap included a page for a retired product, still live and unlinked from the navigation.

security.txt, at /.well-known/security.txt, tells researchers how to report vulnerabilities. Its presence is good practice and worth noting as a positive. Other well-known paths, such as OpenID configuration documents, describe identity integrations.

robots.txt for the staging portal. Each disallowed path goes on the list to examine.
# Read the files that describe the site
curl -s https://staging-portal.prairiefold.example/robots.txt
curl -s https://staging-portal.prairiefold.example/sitemap.xml
curl -s https://staging-portal.prairiefold.example/.well-known/security.txt
Output
User-agent: *
Disallow: /admin/
Disallow: /reports/
Disallow: /api/v1/internal/

HTML, comments and information disclosure

Page source often reveals more than the page shows. HTML comments left by developers, hidden form fields, the names of JavaScript bundles, framework version strings and error pages are all information disclosure sources listed in objective 2.1. HTML scraping, extracting such details automatically from many pages, scales this up; the proxy's search function does a similar job across everything already captured.

In the staging portal, a comment in the login page read "TODO remove test login before go-live", and the main JavaScript bundle referenced an endpoint path that did not appear anywhere in the user interface. An error page triggered by an unexpected character in a search parameter returned a stack trace naming the application framework, its version and internal file paths. None of these was an exploit, but each told an attacker something useful, and each was easy to fix.

Technology fingerprinting

Knowing what an application is built with narrows later testing. Clues include response headers such as Server and X-Powered-By, cookie names typical of particular frameworks, file extensions, the structure of URLs, characteristic JavaScript libraries and error page styles. Tools such as WhatWeb and the Wappalyzer browser extension automate this, and Nmap NSE scripts such as http-headers and http-title add more.

WhatWeb at its least aggressive level. Cookie names, headers and the page title give clues; security headers are noted as positives.
whatweb -a 1 https://staging-portal.prairiefold.example/
Output
https://staging-portal.prairiefold.example/ [200 OK] Cookies[__Host-session,XSRF-TOKEN],
HTTPServer[nginx], HttpOnly[__Host-session], Script[module], Strict-Transport-Security,
Title[Prairiefold Member Portal (Staging)], UncommonHeaders[x-request-id], X-Frame-Options[DENY]

Platform plugins

Content management systems such as WordPress, Drupal and Joomla are extended with plugins and themes, and plugins are a frequent source of vulnerabilities because they are written by many different developers and updated unevenly. Objective 2.2 lists platform plugins under manual enumeration. Testers identify plugins from paths in page source, from readme and changelog files that reveal versions, and with platform-specific scanners. WPScan is the standard tool for WordPress: it enumerates the core version, plugins, themes and users, and can match them against a vulnerability database if given an API token.

The member portal was a custom application, but Prairiefold's marketing subdomain, found in lesson 2, ran WordPress. That site was in scope as part of the public address block. WPScan in its passive detection mode identified eleven plugins from page source, two of them several major versions out of date. Priyanka recorded them for vulnerability analysis and noted that the WordPress user listing endpoint revealed the names of the site's three editors.

WPScan enumerating plugins and themes. Aggressive plugin detection sends many more requests and needs agreement under the rules of engagement.
# Enumerate plugins and themes detected from page source (passive detection mode)
wpscan --url https://news.prairiefold.example/ --enumerate p,t --plugins-detection passive

Directory and file enumeration

Not every page is linked. Administration panels, backup files, old versions, test pages and configuration files may sit on the server without any link pointing to them. Directory enumeration, also called forced browsing or content discovery, requests many likely names from a wordlist and records which exist, using the HTTP status codes to tell.

Reading status codes during directory enumeration.
Status codeMeaning for content discovery
200 OKThe resource exists and was returned
301 or 302 redirectExists, redirects elsewhere; often a directory without a trailing slash, or a login redirect
401 UnauthorizedExists and requires authentication
403 ForbiddenExists (usually) but access is denied: interesting
404 Not FoundDoes not exist, unless the application returns 404 for everything
500 Internal Server ErrorSomething exists and broke when requested; note and investigate gently

Common tools are gobuster, ffuf, feroxbuster and the older dirb and DirBuster. They differ in speed and features: feroxbuster recurses into directories it finds; ffuf is a general-purpose fuzzer that can place the wordlist anywhere in a request. All of them can generate heavy traffic, so rate limits and thread counts matter. A common pitfall is an application that returns 200 for every path, with a friendly "not found" page; tools can filter by response size or words to cope.

ffuf and gobuster for directory enumeration. The wordlist placeholder stands for a content discovery list of common path names; the rate and thread limits follow the rules of engagement.
# Content discovery against the in-scope staging host only, rate limited
ffuf -u https://staging-portal.prairiefold.example/FUZZ -w <content-wordlist> \
     -mc 200,204,301,302,401,403 -rate 20 -o staging-ffuf.json -of json

# The same idea with gobuster
gobuster dir -u https://staging-portal.prairiefold.example/ -w <content-wordlist> -t 5 -o staging-gobuster.txt

Content discovery on staging turned up /backup/ returning 403, /reports/ redirecting to login, /api/docs/ returning a full OpenAPI description of the internal API, and /admin/ returning a login page. The API description was the most valuable find: it documented every endpoint, parameter and response format, including several internal functions the user interface never called.

APIs and virtual hosts

Modern applications are often thin front ends over APIs, and enumerating the API is as important as enumerating the pages. Sources include the proxy history, JavaScript bundles, published or forgotten OpenAPI (Swagger) descriptions, and, for GraphQL APIs, introspection queries that return the schema if left enabled in production. Each discovered endpoint is recorded with its method, parameters and the role required.

A single web server can host several sites, chosen by the Host header in each request. Virtual host enumeration sends requests with different host names to the same address to find sites that have no public DNS record. Like directory enumeration, it is active and uses wordlists of likely names. Staging's address answered one extra virtual host, a monitoring dashboard for the development team, protected by a login.

Web application firewalls and the origin address

Many applications sit behind a web application firewall (WAF), which inspects requests and blocks those that look like attacks, or behind a content delivery network that also filters traffic. Objective 2.2 lists WAF enumeration, including identifying the origin address. Testers need to know whether a WAF is present because it affects test results: a blocked request does not mean the application is safe, only that the WAF stopped that request. Tools such as wafw00f and NSE scripts such as http-waf-detect send requests designed to provoke a WAF and recognize its responses, headers and cookies.

wafw00f identifying a WAF in front of the staging portal. The vendor name is replaced with a placeholder.
wafw00f https://staging-portal.prairiefold.example/
Output
[*] Checking https://staging-portal.prairiefold.example/
[+] The site https://staging-portal.prairiefold.example/ is behind a (vendor) WAF.
[~] Number of requests: 2

The origin is the server that actually runs the application behind the WAF or delivery network. If the origin is reachable directly, an attacker can bypass the WAF entirely. Origins are found through historical DNS records from before the WAF was introduced, certificates that name the origin host in CT logs or internet scan data, other subdomains that point straight at the origin, and email headers or error messages that leak its address. Confirming a suspected origin means sending a request with the application's Host header directly to that address and comparing the response.

For staging, the WAF ran on a reverse proxy at 203.0.113.30. Censys data showed a certificate for staging-portal.prairiefold.example also presented by 203.0.113.31, an address in Prairiefold's own range. A request to 203.0.113.31 on port 8080 with the staging Host header returned the application directly, with no WAF headers and no blocking of a harmless test string that the WAF did block. The origin finding went into the report with a simple remediation: allow connections to the application server only from the WAF.

Ways to find an origin behind a WAF or content delivery network.
Origin clueWhere to find it
Historical A recordsPassive DNS from before the WAF or CDN was added
Certificates naming the hostCT logs and Censys or Shodan certificate searches
Sibling subdomainsNames such as origin, direct or app01 resolving to the client's range
Leaks from the applicationEmail headers, error pages, absolute links

Defending the web footprint

Every web enumeration technique has a matching defense. Remove comments, test code and stack traces before release, and return generic error pages. Do not rely on robots.txt to hide anything sensitive. Keep API descriptions off production and staging unless intended, disable GraphQL introspection outside development, and require authentication for administrative paths and virtual hosts. Keep content management systems and plugins updated and remove unused plugins. Restrict origins so they accept traffic only from the WAF or delivery network. Monitor for content discovery patterns: hundreds of 404 responses from one source in a minute is a clear signal.

Worked problem

Prioritizing the map

From the staging map, Priyanka has: an OpenAPI description at /api/docs/; /backup/ returning 403; a stack trace on a search error; a monitoring dashboard on a virtual host; and the origin at 203.0.113.31 bypassing the WAF. Which should feed testing first, and why?

Show solution
  1. The origin bypass changes how every later test runs and is itself a finding; record it and decide with the client whether tests go through the WAF, around it, or both.
  2. The OpenAPI description lists internal endpoints, the richest set of inputs to test for authorization problems.
  3. The monitoring dashboard is another authenticated surface; note it for testing within scope.
  4. /backup/ at 403 may hold backup files; record it and check whether any file names are accessible.
  5. The stack trace is information disclosure; report it and use the version detail in vulnerability analysis.

Answer: Origin first, then the API, then the dashboard and backup path, with the stack trace reported as disclosure.

Common mistakes

  • MistakeLetting a crawler follow links off the in-scope host.

    InsteadSet the proxy and crawler scope to the in-scope host and exclude destructive actions.

  • MistakeTreating robots.txt as a list of protected areas.

    InsteadTreat it as a hint list; it controls nothing.

  • MistakeRunning content discovery at full speed.

    InsteadLimit threads and rate to what the rules of engagement and the application can handle.

  • MistakeConcluding an application is secure because the WAF blocked a test.

    InsteadIdentify the WAF, look for the origin, and judge the application on its own merits.

  • MistakeIgnoring JavaScript files.

    InsteadRead them for endpoints, configuration and comments.

Summary and key terms

  • Map before testing: proxy history, crawling, manual files, content discovery, fingerprinting and WAF detection combine into a site map.
  • Burp Suite and ZAP record and replay traffic; scope settings keep crawlers on in-scope hosts.
  • robots.txt, sitemap.xml and security.txt are quick, low-impact sources.
  • Comments, hidden fields, JavaScript and error pages disclose information.
  • WPScan and similar tools enumerate platform plugins, a frequent source of weaknesses.
  • gobuster, ffuf and feroxbuster discover unlinked content using status codes.
  • WAF enumeration identifies filtering layers; a reachable origin lets attackers bypass the WAF.
Intercepting proxy
A tool between browser and application that records and lets testers modify traffic.
Crawler
A tool that follows links and forms automatically to discover content.
robots.txt
A file asking search engine crawlers not to index certain paths.
Directory enumeration
Requesting likely paths from a wordlist to find unlinked content.
Virtual host
One of several sites served from the same address, selected by the Host header.
WAF
Web application firewall, which inspects and filters HTTP requests.
Origin
The server behind a WAF or content delivery network that actually runs the application.
OpenAPI
A standard format for describing REST APIs, formerly known as Swagger.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A content discovery tool reports 403 for /backup/. What does that tell you?

    Show answer

    The path probably exists but access is denied; record it and check whether files within it are reachable.

  2. Why do modern crawlers drive a browser engine?

    Show answer

    Single-page applications build navigation with JavaScript, which simple crawlers do not run.

  3. How would you confirm that a suspected origin address serves the application?

    Show answer

    Send a request directly to the address with the application's Host header and compare the response with the one through the WAF.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz