[Sécurité] Authentification MD5
Salut à tous,
J'ai récupéré un script pour administrer mon tracker. Le login avec mot de passe est crypté en md5. Voici le bout de source exemple de l'auteur (original):
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| ob_start('ob_gzhandler');
require_once('functions.php');
//Specify Usernames and MD5ed Passwords here:
//**********************************************
$users['Test'] = '0cc175b9c0f1b6a831c399e269772661'; //Password is 'a'
//NO PASSWORD IS: d41d8cd98f00b204e9800998ecf8427e
//**********************************************
// \/ DO NOT EDIT BELOW \/
//**********************************************
//authentication
function SendAuthReq()
{
header('WWW-Authenticate: Basic realm="Torrent Control"');
header('HTTP/1.0 401 Unauthorized');
site_header();
main_box('Authentication Error!!', 'Incorrect User/Password when accessing Torrent Control');
site_footer();
}
if (!isset($_SERVER['PHP_AUTH_USER'])) {
SendAuthReq();
exit;
}
else {
if($users[$_SERVER['PHP_AUTH_USER']] > '')
{
if($users[$_SERVER['PHP_AUTH_USER']] != md5($_SERVER['PHP_AUTH_PW']))
SendAuthReq();
}
} |
Impossible de m'identifier. Mais j'avoue ne pas bien comprendre le principe. Ai-je besoin d'un fichier .htpasswd?? Si j'ai bien compris, c'est le serveur qui m'identifie.
Que dois-je faire pour acceder à ma page??
Je vous remercie d'avance!