Skip to content

Natas Level 22

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

Username: natas22
URL:      http://natas22.natas.labs.overthewire.org

Study guide

Level map: sign in as natas22 and find the password for natas23.

What this level teaches

How HTTP redirects really work, and how browsers hide what the server sent.

Key ideas

  • A redirect is a response. The server answers with a status like 302 and a Location header, and may still include a body.
  • Browsers follow it automatically, so you never see the body of the first response.
  • curl shows everything. Tools that do not follow redirects, or that print them, reveal the full reply.
  • Server-side logic does not halt. Code that sets a redirect but does not stop executing still produces output.

How to approach it

  1. Request the page without following redirects and read the whole response.
  2. Study the source to learn which parameter triggers the privileged behaviour.

How developers prevent it

Always stop execution after sending a redirect, and perform the authorisation check before generating any sensitive output.