Level 1 Username : narnia1 Password : efeidiedae SSH : narnia.labs.overthewire.org:2226
To solve this level, we first ssh into the narnia server using the credentials provided above. Let’s have a look at the executable for this level and its source code.
As we can see, the executable checks for the existence of an environment variable named ‘EGG’. To read more on environment variables, click here. Therefore, we need to create our shellcode and store it in the environment variable. The executable would then execute our shellcode for us. This would be a good point to read on Buffer Overflow if you’re unfamiliar with that. This link provides good information about it. Since we would be executing our shellcode from the environment variable, this link provides a really nice script to store our shellcode. Let’s now create our shellcode and store that in the ‘EGG’ environment variable.
As we can see above, we now have the shellcode. Let’s store this in the variable now.
Now that our shellcode is loaded, let’s execute ‘narnia1’
Level 2 Username : narnia2 Password : nairiepecu SSH : narnia.labs.overthewire.org:2226