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

Natas Level 12

Natas Level 12 — upload a file the server stores and then serves; learn why trusting the client's filename and file type lets attackers run their own code.

Table of Contents

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

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

Study guide

Level map: sign in as natas12 and find the password for natas13.

What this level teaches

How an unrestricted file upload can turn into remote code execution.

Key ideas

  • Uploads become files on the server. If they land in a folder the web server executes, the file can run as a script.
  • Never trust the client. The filename and extension arrive from the browser, and even hidden form fields can be edited.
  • Execution depends on extension. The web server decides whether to run or merely serve a file by its name.
  • What to run. A tiny server-side script that reads the password file is enough.

How to approach it

  1. Upload a harmless file, then find where it is stored and what name it was given.
  2. Inspect the form and the code to see which part of the name the server chooses and which part you do.
  3. Request the uploaded file from the browser to see what happens.

How developers prevent it

Store uploads outside the web root, generate the filename yourself, validate the file’s true type, and serve uploads from a domain that never executes code.