Monday, July 13, 2015

OverTheWire - Leviathan - Level 3

After logging into leviathan3 and checking the home directory we will see a program called level3. If we run level3 it requests a password. Enter anything other than the password and it tells you "bzzzzzzzzap. WRONG". Use the strings command to get a list of strings in the executable.
strings ./level3
You may be able to see the password in the returned results, but it is not blatantly obvious. If we use the linux command ltrace to find the strcmp function used we may be able to determine what our input is being compared to while it is executing.
ltrace ./level3
After the program executes we see strcmp("h0no33", "kakaka") and then it asks for the password. We know this is not the right comparison, so enter something in again, and you will see the proper strcmp with the actual password. Disregard the \n at the end, it is a new line terminated string.

When you input the password it expects you are dropped into a shell. You can run the whoami command to figure out which user you are, although it should be no surprise that it is Leviathan4. Use the following command to get the password to log in to leviathan4 directly.
cat /etc/leviathan_pass/leviathan4

No comments:

Post a Comment