Posts

Natas 11 -> 12

user: natas11 pass: U82q5TCMMQ9xuFoI3dYX61s7OZD9JKoK OK, this level is a bit tricky. We start out looking at the source code, and we are faced with several functions. xor_encrypt seems to encrypt any text sent to it by xoring the input character by character with the key we want. loadData checks to see if the cookie sent with the data matches the background color, and has the 'showpassword' field in it. If the background color sent with the data and sent in the cookie match,  it stores the color and the showpassword boolean - this is probably the key to getting the key. The big trick here is that there's an XOR encryption going on. At first this might seem tricky, but on closer consideration we remember that if xor myword => cypher, then xor cypher => myword. in the function saveData, we wee that the cookie for the website is set with base64-encode, xor_encrypt, and json-encode. Therefore, we start with the cookie. We know we want to base64-decode, so let&

Natas 10 -> 11

user: natas10 pass: nOpp1igQAkUzaI1GUUjzn1bFVj7xCNzu This looks familiar - but someone got smart and decided to start sanitizing their inputs, it looks like. We can't use ;, |, or & to circumvent the grep command. Clever designers. But what other command exploits might we be able to use? Let's think back to the days when we were command-line masters instead of browser-hackers. I seem to recall that grep had some fancy functionality... like, for instance, the ability to grep over multiple files at once. So what happens if we tell it to do just that? Of course, we don't know what to tell grep to look for, so let's just use the .* operator to tell it to match any number of occurrences of anything. Remember, looking at the source, that our file will be searched over first, so we won't care too much about the massive number of dictionary words that will be spit out after. Let's try it (remember, the second file we should try looking at is the same as last

Natas 9 -> 10

user: natas9 pass: W0mMhUcRRnG8dcghE4qvk3JA9lGt8nDl Hmm. Needle in a haystack, wouldn't you say? Let's take a look at the source code. Looks like the box is looking for a specific 'needle' to be entered to get the password. Well, there might just be an easier way -  let's take a closer look at how the search box is working. Looks like this php code is using 'passthru' to run grep, a shell command. what else could passthru run, however? For those familiar with shell, the ';' character is your friend for multiple commands on a single line. That's what we're going to do here. If we start our box input with ';', we can follow it with commands of our choice! What's more, I seem to remember a helpful hint suggesting that /etc/nats_webpass/natas<level number> always holds the password for the next level. Type ;cat /etc/natas_webpass/natas10 into the search box for the information you  seek.

Natas 8 -> 9

user: natas8 pass: DBfUBfqQG69KvJvJ1iAbMoIpwSNQ9bWe Another secret, but this time the source code shows that the secret has been encoded. The language we're seeing here in the midst of the HTML is PHP. So, let's go to our closest friendly PHP station: the terminal. Running >>>php -a will get you into interactive mode in the terminal. Now it's just a matter of reversing the encryption on the secret. We know that the encoded one is  "3d3d516343746d4d6d6c315669563362" , and that to get it there we ran return bin2hex(strrev(base64_encode($secret))); Therefore, we try the opposite: print base64_decode( strrev(hex2 bin( $encoded))); This yields the secret we were looking for, which when inputted gives us our password.

Natas 7 -> 8

user: natas7 pass: 7z3hEENjQtflzgnT29q7wAvMNfZdh0i9 Ooh, links! But neither one seems terribly helpful. As should be your first instinct by this point, let's look at the developer tools. There's a hlepful comment in there. "hint: password for webuser natas8 is in /etc/natas_webpass/natas8" Well, that seems straightforward. However, http://natas7.natas.labs.overthewire.org/etc/natas_webpass/natas8 doesn't exist. So what are we missing? Closer examination of the links on the home page show us that there's a /index.php bit of each URL that might be important. So let's try it. http://natas7.natas.labs.overthewire.org/index.php?page=/etc/natas_webpass/natas8 should get you what you're looking for.

Natas 6 -> 7

user: natas6 pass: aGoY4q2Dc6MgDq4oL4YtoKtyAg9PeHa1 Well, it looks like we need to input a secret of some sort. If only we knew what it was... Luckily, though, someone left a link to the website source code here. And, what's this? it very conveniently says, right there: include "includes/secret.inc"; So let's start there. That looks like a folder we could try navigating to. http://natas6.natas.labs.overthewire.org/includes/secret.inc yields the secret:  FOEIUWGHFEEUHOFUOIU. Plugging that in gives us the password!

Natas 5 -> 6

user: natas5 pass: iX6IOfmpN7AYOQGPwtn3fXpbaJVJcHfq What's this? The website says we're not logged in. And yet, I distinctly remember inputting a username and password a moment ago... Well, let's look around and see if there's anything we can do about this. If we just try to use our old friend, the developer tools, we probably won't get much of anywhere. But there are some convenient add-ons to any standard browser that will let us examine and even - gasp! - edit  our browser cookies. And it turns out that's exactly what needs doing here. Change the value of the loggedin cookie from 0 to 1 to tell the website that it should let you in.