OverTheWire: Leviathan Level 7
This is the final level in the wargame Leviathan which has taught us commands and functions related to executables and Linux. So let’s SSH into the machine and get started. If you haven’t gotten the password, you can read my walkthrough of the last level.
Username: leviathan6
Password: UgaoFee4li
Listing the files in the home directory.
We are given another binary file. So let’s run the binary file and see what information it gives us.
It tells us that when we run the binary file, we also need to supply a 4 digit code. So let’s try and enter in a 4 digit code and see what it outputs.
Okay, so it looks like we have to try and brute-force the 4 digit combination for the file. So to do this, what you can do is create a directory in in /tmp
and write some code that executes this file with the 4 digit code incrementing. But I am just going to use the terminal to do so in a one liner using a bash for loop.
Now this takes some time to go through all the 4 digit numbers, so be patient.
Execution stops as it appears when we gave it the correct 4 digit code, it executed a shell for us where we are leviathan7
. So we can go and have a look at the password file for the final password.
And the final password is ahy7MaeBo9
.
For those that are interested, we can actually change the command so it also prints out the 4 digit code so we know which number was the one that was correct.
And the correct 4 digit value was 7123
Thank you for reading.