Skip to content

Natas Level 16

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

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

Study guide

Level map: sign in as natas16 and find the password for natas17.

What this level teaches

Blind command injection through whatever characters the filter still allows.

Key ideas

  • Shell expansion. A shell evaluates certain constructs before running the command, so you can influence what runs without using the blocked characters.
  • Side-channel output. The page still shows whether a word was found, which is the oracle.
  • Building on earlier levels. The method resembles Level 15, applied to a shell command.
  • Automation. Guess the secret one character at a time with a script.

How to approach it

  1. Compare this filter with the one from Level 10 and list the characters that are still allowed.
  2. Look up what those allowed characters can still do inside the command you saw.
  3. Use the page's reply as a true/false signal and automate the guessing.

How developers prevent it

As with all injection bugs: separate data from code. Do not pass user input through a shell at all.