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

Vortex Level 4

Vortex Level 4 — a common format-string bug guarded by a check on argc, which makes you think about how programs are started.

Table of Contents

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

To exec or not to exec

This is the common format string bug, exploit it with care though as a check is made with argc. What is the layout of a process’s memory? How are programs executed?

Reading Material

Study guide

Level map: logged in as vortex4, obtain access to vortex5.

What this level teaches

Format-string exploitation under an unusual constraint.

Key ideas

  • Format strings. The page links papers on the technique, the classic guides to reading and writing memory with printf.
  • The argc check. The program verifies the number of arguments, so you must find another way to deliver the format string and control execution.
  • Process memory layout. The page asks: what is the layout of a process’s memory, and how are programs executed? Environment variables, arguments and the loader all matter.
  • Executing programs. execve lets you start a program with arbitrary argument and environment settings, including an unusual argc.

How to approach it

  1. Read the code and find where the format string comes from.
  2. Work out how to start the program with the argument count and environment you need.
  3. Use gdb to find the stack positions and build the write.

Why it matters

Understanding how the kernel and loader hand a program its arguments helps in many exploitation scenarios.