Natas · OverTheWire

Natas Level 23 → Level 24

Level 23

Username : natas23
Password :D0vlad33nQF0Hz2EP255TP5wSW9ZsRSE
URL : http://natas23.natas.labs.overthewire.org

Solution

To solve this level, we first log into the natas23 application using the credentials provided above.

The application presents us with an input field for a password. After submitting a random password, the application responds with ” Wrong! “. Let’s go through the source code and try to figure out the application’s functionality.

<?php
if(array_key_exists("passwd",$_REQUEST))
{
    if(strstr($_REQUEST["passwd"],"iloveyou") && ($_REQUEST["passwd"] > 10 ))
    {
        echo "<br>The credentials for the next level are:<br>";
        echo "<pre>Username: natas24 Password: <censored></pre>";
    }
    else
    {
        echo "<br>Wrong!<br>";
    }
}
// morla / 10111
?>

As we can see, the application performs the following checks to print the password:

  1. The passwd REQUEST variable should contain ” iloveyou “.
  2. The passwd REQUEST variable should be more than 10.

To solve this issue, let’s refer to the following two links: String Occurrence and String Conversion. As we can see, if the passwd field contains ” iloveyou ” and a number greater than 10, the if statement would result in true thus printing our password.

 

As we can see, password value ” 11iloveyou ” works well to print the password.

Level 24

Username : natas24
Password : OsRmXFguozKpTZZ5X14zNO43379LZveg
URL : http://natas24.natas.labs.overthewire.org

One thought on “Natas Level 23 → Level 24

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s