Bandit 23

OverTheWire Bandit 23

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: This level requires you to create your own first shell-script. This is a very big step and you should be proud of yourself when you beat this level!

NOTE 2: Keep in mind that your shell script is removed once executed, so you may want to keep a copy around…

bandit23a

Once again, looking under /etc/cron.d reveals there isa cronjob_bandit24 file. Looking inside we see that it runs whatever files are located inside /var/spool/$myname, before deleting them.

bandit23b

We need to create a bash script in the spool/bandit24 folder to reveal the password to us. I use the echo command to append a series of commands into /var/spool/bandit24/b.sh. Looks like i made a typo on line 1.

bandit23c

I chmod the permission on the file b.sh, however I think it inherited the execute flags needed from the folder permissions. The cron job runs once a minute. After a period of time, you can see that the spool folder is deleted. I then check to see if we have the results waiting in /tmp/ant24 file.

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