Skip to content
Info disclosure Write-up Beginner

Directory Transversal at 404 (not found)

The author found that a 404 page on a subdomain returned 403 for certain directory names, and further brute-forcing under that forbidden path revealed 302 redirects to executable files. An attacker could discover hidden directories and files that the site did not intend to expose.

medium.com

Published on medium.com

Today I am going to share how I got the directory path transversal at 404 status code….

Levi Ackerman, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server handled unknown paths inconsistently, returning 404 for most but 403 for some directories, and the forbidden directory still allowed discovery of files beneath it.

Impact

The author could discover hidden directories and executable files that were not meant to be listed, potentially exposing sensitive content.

What the attacker needed

None

How it was found

  1. Notice many subdomains returning 404 and check for subdomain takeover.
  2. Brute-force directories on the 404 page filtering for 200 responses.
  3. Repeat the brute force filtering for 404 responses to see which words were missed.
  4. Collect directory names that did not return 404 and test them on the 404 subdomain.
  5. Brute-force under the resulting 403 forbidden directory filtering for 302 and 200 responses.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A website often shows a '404 not found' page when a path does not exist. Here, some paths that looked like 404s actually behaved differently, and by guessing more names under a hidden folder the author found links to files. This is a way of finding things the site owner did not mean to show.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.