Previous Level: Level 4
Login
SSH: ssh leviathan4@leviathan.labs.overthewire.org -p 2223
Password: vuH0coox6m
(outdated - should be gathered through previous level)
A little bit of Theory
Binary code is the most basic representation of data for a computer. This is what the computer uses internally. It comes from the binary number system, which only includes ‘0’ and ‘1’ as digits, also called ‘bits’.
In computer science, there are different encodings to represent human-readable text. The most basic and common one is the ‘American Standard Code for Information Interchange’ (ASCII). ASCII uses 7 bits to represent one character. Generally, if you were to transform binary to ASCII per hand, you would first transform binary to our decimal system and look up the corresponding letter in an ASCII table. Example: ‘01000001’ -> ‘65’ -> ‘A’.
Solution
In the home directory, we find a directory called ‘.trash’ that is new and belongs to the ’leviathan4’ group. So we check it out.
|
|
There is a SUID binary belonging to user ’leviathan5’. So as always, we try and figure out what it does.
|
|
It returns a string of zeros and ones. This is binary. - Using ltrace, it seems like it opens the password file for user ’leviathan5’ and most likely transforms it into this binary string. So our goal is to reverse the binary into ASCII format and hopefully get the password.
There are different ways to go about this transformation. We could do it by hand, use a website or with the command line. We could write a short program in python or another language. I wanted a short and easy solution for the command line. Quick googling shows me the following example with Perl: bash echo 0100000101000010 | perl -lpe '$_=pack"B*",$_'
. So let’s try it. (Hint: Make sure to not leave any space between the bits.)
|
|
And it worked. Testing the resulting string shows that it is indeed the correct password for the next level.
https://overthewire.org/wargames/leviathan/leviathan5.html
Next Level: Level 6