Bandit Level 21 → Level 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.
Level Answer
1. ls [FILE]
$ ls /etc/cron.d/
cronjob_bandit22 cronjob_bandit23 cronjob_bandit24 popularity-contest
2. cat [FILE]
$ cat /etc/cron.d/cronjob_bandit22
@reboot bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null
* * * * * bandit22 /usr/bin/cronjob_bandit22.sh &> /dev/null
3. cat [FILE]
$ cat /usr/bin/cronjob_bandit22.sh
#!/bin/bash
chmod 644 /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv
cat /etc/bandit_pass/bandit22 > /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv
4. cat [FILE]
$ cat /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv
Yk7owGAcWjwMVRwrTesJEwB7WVOiILLI
5. ssh [-p port] [user@]hostname
- [-p port] Port to connect to on the remote host.
$ ssh -p 2220 [email protected]
Level Password
Yk7owGAcWjwMVRwrTesJEwB7WVOiILLI