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

Bandit Level 22

Bandit Level 22 — read a cron job's configuration and script to see what a scheduled task does.

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.

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 bandit21, find the password for bandit22.

What this level teaches

How Linux schedules recurring work, and why reading someone else’s script is a security skill.

Key ideas

  • cron is a daemon that runs commands at scheduled times. System-wide entries live in /etc/cron.d/.
  • Crontab syntax. Five time fields (minute, hour, day of month, month, day of week) followed by the user and the command. man 5 crontab explains each field.
  • Whose permissions? A cron job runs as the user named in its entry, which may not be you.
  • Follow the data. The job’s script reads something and writes it somewhere; your job is to see where.

How to approach it

  1. List /etc/cron.d/ and read the entry for the next user.
  2. Open the script it runs and trace, line by line, what it reads and where it writes.
  3. Go and look at the output location.

Why it matters

Cron is a favourite place for misconfigurations that expose data or allow privilege escalation, and attackers also use it for persistence.