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

Narnia Level 6

Narnia Level 6 — a harder overflow where relying on injected shellcode is unattractive; think about reusing code that already exists in the program.

Table of Contents

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

There is no information for this level, intentionally.

Study guide

Level map: logged in as narnia6, find the password for narnia7.

What this level teaches

Reusing existing code rather than injecting your own, a stepping stone to modern exploitation.

Key ideas

  • Return-to-libc. The C library is already loaded and contains useful functions. Redirecting execution to one with chosen arguments avoids needing shellcode.
  • Calling conventions. On 32-bit x86, arguments go on the stack; you have to place them where the called function expects.
  • Finding addresses. gdb and ldd help locate library functions, and addresses differ between runs if randomisation is on.
  • Read the source closely. The program’s structure determines which pointers or return addresses are reachable.

How to approach it

  1. Read the source and list what can be overwritten and what it controls.
  2. Locate the function you want to call and the string you want to pass it.
  3. Assemble and test the payload in gdb before running it for real.

Why it matters

Return-to-libc leads directly to return-oriented programming (ROP), the standard bypass for non-executable stacks.