~ Level 22→23 ~
Level Description
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.
Commands that may be needed: cron, crontab, and crontab(5) (use “man 5 crontab” to access this)
Research Before Solving
Research will be done as we go through the level!
Solution Walkthrough
If you haven't already, log in to the OverTheWire server as bandit22. According to the description, we need to navigate to the /tmp/cron.d/ directory. Once there, we will use ls again to list the files.

Just as we did last time, cat the file related to the next level: cronjob_bandit23.

We will once again use cat to read the contents of the script we just located.

Now comes the time to research. A variable is created called myname and the value of the command whoami is assigned to it. The current user will print out when issuing the whoami command. The script will then create another variable called mytarget. The variable's value is then set by first using an echo command. This output is piped to the md5sum command which will create a hash out of it. Lastly, cut will be used to print this output to the variable. The final piece of the script is saying the password will be put into a directory named as the hash.
Now that we have this information, we can use part of the script to determine the hash for user bandit23.To do this we will run echo I am user bandit23 | md5sum | cut -d ' ' -f 1

We've mimicked the hash that's used as the file name. To locate the password we will use the following command: cat /tmp/8ca319486bfbbc3663ea0fbe81326349

We've found the password for the next level: jc1udXuA1tiHqjIsL8yaapX5XIAI6i0n!