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

Vortex Level 3

Vortex Level 3 — a stack overflow with a twist, involving shellcode that must call setuid and the limits of overwriting constructor and destructor tables.

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

A Stack Overflow with a Difference

This level is pretty straight forward. Just sit down and understand what the code is doing. Your shellcode will require a setuid(LEVEL4_UID) since bash drops effective privileges. You could alternatively write a quick setuid(geteuid()) wrapper around bash.

NOTE: ctors/dtors might no longer be writable, although this level is compiled with -Wl,-z,norelro. Lookup some information about this e.g. here

Reading Material

Study guide

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

What this level teaches

Writing shellcode that survives dropped privileges, and understanding binary hardening flags.

Key ideas

  • Bash drops privilege. The page notes that bash drops effective privileges, so your shellcode needs to call setuid itself, or you can use a tiny wrapper that does setuid(geteuid()).
  • ctors and dtors. Old writable tables of constructors and destructors were classic overwrite targets.
  • Relocation hardening. The level is compiled without full relocation read-only (norelro), yet the page notes the tables might no longer be writable; research why.
  • Reading. “Smashing the Stack” and “Bypassing StackGuard and StackShield” are linked.

How to approach it

  1. Read the code until you can say what it does line by line.
  2. Decide which overwrite target will work on this system, and verify it in gdb.
  3. Write shellcode that sets the right user ID before starting a shell.

Why it matters

Privilege handling in shells and the evolution of mitigations like RELRO explain why old exploit recipes stop working.