Writeups OverTheWireBanditLinuxcron

Bandit 21 Writeup - OverTheWire

Writeup for Bandit level 21 from OverTheWire: reading a cron job to find a temp file.

Contents

Wargame: Bandit

Level: 21

Category: Linux Fundamentals

Description

A cron job is running periodically as bandit22. Inspecting it reveals that it writes the bandit22 password to a predictable temp file.

Overview

Solution

Step 1: Find the Cron Job

ls /etc/cron.d/
cat /etc/cron.d/cronjob_bandit22

Step 2: Read the Script

cat /usr/bin/cronjob_bandit22.sh

Step 3: Read the Temp File

cat /tmp/<hash>

Password

WdDozAdTM2z9DiFEQ2mGlwngMfj4EZff

← Back to Blog