Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildNov 24, 17:25

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/natas/natas25.md
URL /wargames/natas/natas25/
Date 2026-04-07

Natas Level 25

Natas Level 25 — a weak path filter and a logged User-Agent combine into log poisoning; learn how reading a log file can execute attacker-supplied code.

Table of Contents

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

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

Study guide

Level map: sign in as natas25 and find the password for natas26.

What this level teaches

Chaining two small weaknesses into a much bigger one.

Key ideas

  • Naive filtering. A filter that removes ../ once may be defeated by input that reconstitutes the sequence after removal.
  • Local file inclusion. If the application includes a file whose path you can influence, it will run any PHP it contains.
  • Log poisoning. Applications log request details such as the User-Agent header. If you can include the log file, anything you put in that header becomes code.
  • Request headers again. You control them, as in Level 4.

How to approach it

  1. Read how the language parameter is filtered and how the log filename is chosen.
  2. Plan the sequence: get your own text into the log, then include the log.

How developers prevent it

Resolve and validate paths against an allow-list, never include files by user-supplied name, and store logs where the web application cannot execute them.