I was testing small script to try to find out the difference
test.php:
<html>
<body><link rel='stylesheet' property='stylesheet' id='s' type='text/css' href='/template/s.css' media='all' /><iframe id='iframe' src='https://www.root-me.org/?page=externe_header'></iframe>
<h1>Authentication v 0.04</h1>
<form action="" method="GET">
Login <br/>
<input type="text" name="username" /><br/><br/>
Password <br/>
<input type="password" name="password" /><br/><br/>
<br/><br/>
<input type="submit" value="connect" /><br/><br/>
</form>
<fieldset><legend>Authentication log</legend><pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo $_GET['username'].'Failed';
$first_line = strstr($_GET['username'], "\n", true);
?>
</pre></fieldset></body></html>
When i try to make Get request Like this :
http://localhost/test.php?username=%0D%0Aadmin%0D%0whatever&password=password
the result :
admin authenticated
whatever failed
how i got this result ?
& if want to check if there is 2 lines
i can check with
$first_line = strstr($_GET['username'], "\n", true);
now i check for \n
not %0D%0A
so what is the difference between them ?