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

Bandit Level 23

Bandit Level 23 — read a shell script run by cron and work out what it computes and for whom.

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

Level Goal

A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in /etc/cron.d/ for the configuration and see what command is being executed.

NOTE: Looking at shell scripts written by other people is a very useful skill. The script for this level is intentionally made easy to read. If you are having problems understanding what it does, try executing it to see the debug information it prints.

Commands you may need to solve this level

cron, crontab, crontab(5) (use “man 5 crontab” to access this)

Study guide

Level map: logged in as bandit22, find the password for bandit23.

What this level teaches

Reading shell scripts critically, including who a script runs as.

Key ideas

  • Command substitution. $(command) replaces itself with that command’s output, so scripts can build names or values on the fly.
  • Identity. whoami prints the current user. A script run by cron reports the cron entry’s user, not yours.
  • Hashing. md5sum turns any text into a fixed-length fingerprint. A script can use it to derive an unguessable-looking filename from a known string.
  • Debugging. The Level Goal suggests running the script to see its debug output; try each piece in the terminal individually.

How to approach it

  1. Read the script slowly and write in your notes what each line does.
  2. Ask: what value does whoami return when cron runs it, and what string gets hashed?
  3. Reproduce that computation yourself, then look where the script saved its result.

Why it matters

“Security through an obscure filename” fails once the algorithm is visible. Auditing scripts and spotting such patterns is routine code-review work.