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

Semtex Level 2

Semtex Level 2 — a program checks your user ID; trick it into seeing a different one using function interception.

Table of Contents

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

Dynamic tricks

This program checks your user ID.

Perhaps you can trick it, so that it thinks you have a different one.

Think dynamically.

Reading Material

Study guide

Level map: the goal is to make the program believe you are a different user.

What this level teaches

Dynamic tricks: changing a program’s behaviour without changing the program.

Key ideas

  • Library calls can be replaced. On Linux, the dynamic linker can be told to load your own version of a function before the system’s, so the program calls yours.
  • Think dynamically. The page’s hint is to think about what happens at run time rather than in the file on disk.
  • The reading link. The page points you to a search about Linux function interception.
  • Limits. Setuid programs ignore some of these mechanisms for safety; understanding which is part of the challenge.

How to approach it

  1. Find which function the program uses to learn the user ID.
  2. Research function interception on Linux.
  3. Build and test a small replacement.

Why it matters

Interposition is used by profilers and debuggers as well as by malware.