tutorial · bandit

Bandit Level 22 → 23

Reproduce a scheduled script's deterministic filename calculation.

By

banditcronshellhashing
Marks this level complete in your browser.

Goal

Inspect the bandit23 cron script and determine the temporary filename it generates for the target user.

Why this matters

Reading a script as a data-flow specification helps reproduce deterministic transformations without running privileged code.

Progressive hints

  1. Hint 1

    Read both the cron entry and script.

  2. Hint 2

    Identify the value that changes with the account name.

  3. Hint 3

    Run the same pipeline using bandit23 as the input identity.

Method

Run only the lines that match the evidence you observe.

cat /etc/cron.d/cronjob_bandit23
cat <script-path-from-cron>
printf '%s' 'I am user bandit23' | md5sum
cat /tmp/<derived-name>

Expected non-secret observation

The locally reproduced digest matches the script's filename convention and identifies the readable output.

Explanation

A deterministic hash gives the same output for the same exact input, including spaces and newline behavior.

Troubleshooting

  • Mirror the script's echo/printf behavior exactly.
  • Use the destination username, not the current username.

Safety and cleanup

  • Use only the OverTheWire game host and your own local practice directory.
  • Do not paste a level password into this site, screenshots, notes, or submissions. Baitaphish never asks for credentials.
  • Treat commands as learning prompts: inspect paths and flags before running them.

Completion and next step

Use the recovered credential only in the official Level 23 login. Then mark this transition complete and continue.