Bandit 22

OverTheWire Bandit 22

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.

bandit22a

Again, under /etc/cron.d folder is a cronjob_bandit23 script. We use the cat command to look inside.

We see it building the string using the whoami command, performing an md5 checksum on it, and setting $mytarget to the result. Finally it writes the contents of bandit_pass/bandit23 password file to the file under /tmp.

bandit22b

We emulate the script, substituting the correct username bandit23 into the md5 line. Once we have the result, we know the name of the file under /tmp.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s