TExcelTAD
Home › Web Application Security: OWASP Top 10, APIs & Authentication › Testing Methodology: OWASP WSTG and DevTools

Testing Methodology: OWASP WSTG and DevTools

Knowing forty vulnerability classes doesn't make a test. A web assessment needs a method: what is in scope, which areas are covered in which order, what evidence is kept, and when a test stops. Without one, testers chase the first interesting bug and miss the access-control hole two pages away. The OWASP Web Security Testing Guide (WSTG) is the open, community-maintained method most testers build on; its stable release is version 4.2, and a version 5 is in development. This lesson walks through its structure, then performs the first phase, information gathering, against a toy app in your sandbox with nothing but curl, and closes with the browser's own testing tool, DevTools. The legal frame comes first, as always: Authorization, Scope and Rules of Engagement.

The WSTG at a glance

Every test in the WSTG has an id such as WSTG-ATHN-03, a description, how to test, and how to fix. The categories, with the lessons of this course that teach them:

Category Id prefix Examples Lessons
Information Gathering INFO fingerprinting, entry points, comments, metafiles, application map this lesson
Configuration and Deployment Management CONF HTTP methods, HSTS, admin interfaces, file extensions, cloud storage (CSP: v5 draft) headers, HTTP
Identity Management IDNT roles, registration, account enumeration password login
Authentication ATHN credentials over TLS, lockout, bypass, remember-me, weak reset, MFA MFA, passkeys
Authorization ATHZ path traversal, bypassing authorization, privilege escalation, IDOR (OAuth weaknesses: v5 draft) IDOR, OAuth flaws
Session Management SESS cookie attributes, fixation, CSRF, logout, timeouts, hijacking (JWT: v5 draft) cookies, sessions, CSRF
Input Validation INPV XSS, SQL/LDAP/XML/command injection, SSTI, SSRF, smuggling the Injection section, SSRF
Error Handling ERRH error codes, stack traces HTTP
Cryptography CRYP weak TLS, padding oracles, cleartext, weak algorithms Applied Cryptography
Business Logic BUSL data validation, workflows, limits, uploads, abuse business logic, upload
Client-side CLNT DOM XSS, JavaScript execution, HTML injection, open redirect, CORS, clickjacking, WebSockets, postMessage, browser storage DOM XSS, open redirect, WebSockets
API Testing APIT GraphQL GraphQL

The ids and categories are those of v4.2. The v5 draft ("latest" on the WSTG site) adds tests such as Content Security Policy, web cache poisoning, OAuth weaknesses and JSON Web Tokens, and renumbers some sections, so always cite the version with an id.

A typical engagement runs: scope and rules of engagement signed → information gathering and mapping → configuration → identity, authentication, session → authorization (with two or more test accounts per role) → input validation → business logic and client side → retest of fixes. Each test produces evidence (request, response, screenshot, time) whether it found something or not, because "tested, not vulnerable" is part of the report.

Information gathering against a toy app

The toy app runs on 127.0.0.1 in your sandbox and plays a small shop. Information gathering (WSTG-INFO) reads only what the application publishes: metafiles, page source, linked scripts, headers. Nothing here sends a payload.

bash · try it yourself
mkdir -p site/static
cat > site/index.html <<'HTML'
<!doctype html><title>Lab Shop</title>
<!-- TODO remove before go-live: staging admin at /admin-staging/ (user: test) -->
<script src="/static/app.js"></script>
<a href="/products">Products</a> <a href="/account">Account</a>
HTML
cat > site/static/app.js <<'JS'
const API = "/api/v2";
fetch(API + "/products"); fetch(API + "/me");
// legacy endpoints, still used by the old mobile app:
const LEGACY = ["/api/v1/users", "/api/v1/export"];
JS
printf 'User-agent: *\nDisallow: /admin-staging/\nDisallow: /api/v1/\n' > site/robots.txt
mkdir -p site/.well-known && printf 'Contact: mailto:security@lab.test\nExpires: 2027-01-01T00:00:00.000Z\nPolicy: https://lab.test/security-policy\n' > site/.well-known/security.txt
python3 -m http.server 8000 --bind 127.0.0.1 --directory site >server.log 2>&1 &
for i in $(seq 50); do curl -s -o /dev/null http://127.0.0.1:8000/ && break; sleep 0.1; done
B=http://127.0.0.1:8000
echo "== WSTG-INFO-02 fingerprint (Server header)"
curl -sI $B/ | grep -i '^server:' | tr -d '\r'
echo "== WSTG-INFO-03 metafiles"
curl -s $B/robots.txt
curl -s $B/.well-known/security.txt | grep -E '^(Contact|Policy)'
echo "== WSTG-INFO-05 comments in page source"
curl -s $B/ | grep -o '<!--.*-->'
echo "== WSTG-INFO-06/07 entry points from linked JavaScript"
curl -s $B/ | grep -oE 'src="[^"]+"' | cut -d'"' -f2 | while read -r js; do
  curl -s "$B$js" | grep -oE '"/api/[^"]*"' | tr -d '"'
done | sort -u
kill %1
== WSTG-INFO-02 fingerprint (Server header)
Server: SimpleHTTP/0.6 Python/3.12.3
== WSTG-INFO-03 metafiles
User-agent: *
Disallow: /admin-staging/
Disallow: /api/v1/
Contact: mailto:security@lab.test
Policy: https://lab.test/security-policy
== WSTG-INFO-05 comments in page source
<!-- TODO remove before go-live: staging admin at /admin-staging/ (user: test) -->
== WSTG-INFO-06/07 entry points from linked JavaScript
/api/v1/export
/api/v1/users
/api/v2

In under a second of reading, the map grew: a staging admin area and a user name hint from an HTML comment, an old v1 API with a user export that robots.txt asks crawlers to skip (which, to a tester, is a list of interesting places, never an access control), the current /api/v2 base path (its endpoints are built by string concatenation, so a grep for literal paths misses them: reading the script, or watching DevTools, finds /products and /me), the server software and version, and the organisation's disclosure contact. Each item becomes a test case later: is /admin-staging/ reachable and protected (CONF-05)? Does /api/v1/export check authorization like v2 does (API9)? Each is also a finding in itself if it shouldn't be public.

DevTools: the tester's built-in tool

Every browser ships an inspection toolkit (F12) that covers much of a first pass without any extra software:

Panel What a tester uses it for
Network every request and response with headers, cookies, timing; "Copy as cURL" to replay a request in a terminal; "Preserve log" across redirects (to watch an OAuth flow); filter by Fetch/XHR to list API calls
Application (Storage in Firefox) cookies with their Secure/HttpOnly/SameSite flags, localStorage, sessionStorage, IndexedDB, service workers, cache storage
Sources (Debugger) the JavaScript bundles (with source maps, sometimes the original source), search across all scripts for api/, token, innerHTML, breakpoints on DOM changes
Console CSP and mixed-content errors, CORS failures; calling the page's own functions; postMessage tests
Elements the live DOM after scripts ran (where DOM XSS shows up), hidden form fields, disabled buttons
Security (Chromium) the certificate and TLS details of the page

DevTools sees only what your browser does; an intercepting proxy (next lesson) adds modifying, replaying and automating requests.

How a methodology helps detection, for defenders

The same structure works in reverse: run the WSTG information-gathering tests against your own applications before release (remove comments, staging links and source maps, review robots.txt, retire v1), and turn the WSTG categories into security requirements and test cases (the OWASP ASVS does exactly this). Logs of robots.txt-listed paths being requested, or of /api/v1/ traffic from browsers, show who else is reading the map.

Pitfalls

  • Skipping the boring phases: most high-impact findings come from mapping (a forgotten endpoint) and authorization with several accounts, not from clever payloads.
  • Testing outside the agreed window or scope because a mapped host "looks related": check the scope document; ask.
  • No evidence for negative results: a report that says "not vulnerable" without what was tested can't be trusted or repeated.

Practice

1. Which WSTG category would cover each: a missing HttpOnly flag; an invoice readable by another user; a coupon used twice?

SESS (cookie attributes, WSTG-SESS-02), ATHZ (IDOR, WSTG-ATHZ-04), BUSL (business logic, e.g. WSTG-BUSL-05 number of times a function can be used).

2. As the developer of the toy shop, list three changes the information-gathering run suggests.

Remove the HTML comment (and strip comments in the build); retire or protect /api/v1/ and remove the legacy list from the shipped JavaScript; protect or remove /admin-staging/ instead of hiding it in robots.txt; optionally reduce the Server banner.

Test yourself

What is the OWASP WSTG?

  1. A list of the ten biggest risks
  2. A testing methodology with categorised test cases (INFO, CONF, ATHN, ATHZ, SESS, INPV…)
  3. A web application firewall
  4. A scanner

robots.txt disallows /admin-staging/. What does that mean for security?

  1. The path is protected
  2. Nothing: it is a request to crawlers, and a pointer to interesting paths for anyone reading it
  3. The path is deleted
  4. Browsers block it

Which DevTools feature turns a browser request into a terminal command?

  1. Elements > Edit as HTML
  2. Network > Copy as cURL
  3. Console > clear
  4. Security > View certificate