Level3
Website URL: http://overthewire.org/wargames/leviathan/leviathan3.html
Let’s login with leviathan2

Let’s have a look at the contents of the current directory

There is an executable file check
in the directory. Let’s try and execute it.

Well, it seems that we can read a file using this executable. Let’s try this on our password file.

Well, you didn’t expect it to be that easy, did you? Let’s have a look at the

So, after ensuring that we have read-only access to the provided file name, the program gives us the output of the provided file name. Note that the filename is being passed directly to the system call. Meaning we can chain additional commands to it. Let’s try to get a shell using this.

We got a shell for leviathan3. Now a simple cat command to get the password.
Level completed! Credentials obtained:
Username: leviathan3
Password: **********