OverTheWire Natas Level 8 Walkthrough

Today we're doing a walkthrough of level 8 of the Natas CTF wargame hosted at:

http://natas8.natas.labs.overthewire.org

In order to access the level, we will need to authenticate into the webpage by providing the current level of the game as the username (natas8) and the password we obtained from the previous level as the password.  After we've authenticated into the page, we see this:


It looks like we will need to provide the form with the right string to get the password for the next level.  Let's take a look at the sourcecode link in the corner:

http://natas8.natas.labs.overthewire.org/index-source.html


According to the source code, the $encodedSecret string is transformed by the encodeSecret function, and if the string we submit to the form matches the transformed $encodedSecret, then the password for natas9 will be displayed.

The $encodedSecret is first encoded into base64, then the string is reversed, and the reversed string is converted from binary to hex format.

So, to decode the secret string, we will have to perform the exact reverse operations.  We'll use an online code sandbox website to perform these operations.  First convert the encoded string from hex to binary format using hex2bin, then reverse the resulting string using strrev, and finally we decode the reversed string from base64 and receive the fully decoded string.

https://sandbox.onlinephpfunctions.com


After typing in our desired code, we press the "Execute code" button and receive the string located at the bottom of the previous screenshot.  Now to plug that string into the form on the Natas8 homepage.

http://natas8.natas.labs.overthewire.org


We submit the query, and...


Summary

Natas8 required us to look at its page source to obtain an encoded string which was subjected to specific operations in order to encode it.  To obtain the correct query string to obtain the password for the next level, we had to perform decoding on encoded string, which involved performing the reverse of the operations which were applied to the string to encode it.  Once we submitted the decoded string to the Natas8 homepage, we were able to access the password for Natas9.

Finish 











Comments

Popular posts from this blog

TryHackMe - Windows PrivEsc - Walkthrough

TryHackMe - Reversing Elf - Walkthrough

TryHackMe - XSS - Walkthrough