BanditOverTheWire

Bandit22

Website URL: http://overthewire.org/wargames/bandit/bandit22.html

 

Let’s log into the game server as bandit21.

Fig 1.

The task:

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.

Let’s have a look into this directory /etc/cron.d

ls /etc/cron.d
Fig 2.

As must be evident, the relevant file here is cronjob_bandit22. Let’s have a look into the file.

cat /etc/cron.d/cronjob_bandit22
Fig 3.

Now for the script that this job is executing.

cat /usr/bin/cronjob_bandit22.sh
Fig 4.

As is evident from the code, it seems we can find out the password from this file: /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv

cat /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv
Fig 5.

Mission accomplished!

Leave a Reply

Your email address will not be published. Required fields are marked *