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

Natas Level 30

Natas Level 30 — a Perl database call quotes a single value, but not when it receives a list; learn how SQL injection survives an escaping function.

Table of Contents

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

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

Study guide

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

What this level teaches

How a subtle API behaviour defeats escaping, and why parameter handling in CGI scripts matters.

Key ideas

  • Escaping function. quote() normally turns a string into a safe SQL literal.
  • Repeated parameters. In Perl CGI, a parameter provided several times can become a list rather than a single value, which changes what other functions do with it.
  • Second argument. The quote function can take an optional data type that changes how it formats the value.
  • Read the library docs. The documented behaviour of quote() with its second argument matters.

How to approach it

  1. Read the script and find where your input reaches the query.
  2. Look up how Perl CGI handles repeated parameters and what the quote function does with the extra argument.

How developers prevent it

Use placeholders in prepared statements instead of escaping manually, and treat parameters as having a single expected type.