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/natas29.md
URL /wargames/natas/natas29/
Date 2026-04-07

Natas Level 29

Natas Level 29 — a Perl script opens a filename taken from the request; learn how Perl's open function can run commands.

Table of Contents

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

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

Study guide

Level map: sign in as natas29 and find the password for natas30.

What this level teaches

How features of a language runtime can turn a file parameter into command execution.

Key ideas

  • Perl’s open. In its two-argument form, the string you provide is interpreted: certain characters make Perl run a command rather than open a file.
  • Filters. The application tries to block obvious abuse, so the details of the filter matter.
  • Encoding. URL-encoded characters can pass through places raw ones do not.
  • Not PHP. The earlier levels were PHP; this one shows the same ideas in another language.

How to approach it

  1. Notice that the page parameter names a file, and read the Perl documentation for open.
  2. Test what the filter blocks, then find a way to express the command you need.

How developers prevent it

Use the three-argument form of open with an explicit mode, validate filenames, and never pass user input to the shell.