Login

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

Doc

strcmp
The strcmp() function compares two strings character by character. If the strings are equal, the function returns 0.
Common C vulnerabilities.

Solution

This is another quick solution, the index page seems to take in the input as password and that is about it.

gif

Let`s take a look at the code section.
Relevant snippet :

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

This is a 1 to 1 copy of the natas 23 level, the only difference being that this time, we know nothing about the expected input. In order to get access for the next level, the result of the strcmp function should be 1 <=> strcmp returns 0 which only occurs when the strins are equal.

gif

The input parameter is treated as a string but, if you try to pass it as an array for example the return of the strcmp function is an exception which in turn results 0 and grants access further.

gif

Credentials :
Username: natas25
Password: ckELKUWZUfpOv6uxS6M7lXBpBssJZ4Ws