[thelist] Possible exploit

Kae Verens kverens at contactjuggling.org
Sat Nov 22 09:07:38 CST 2003


John C Bullas wrote:
> is this a script to report new links to your site  (ie. there is a 
> referrer URL)?
> 
> If yes, interested

ok. a script to report new referers for your site. PHP+MySQL:

$infoemail='your at email.address';
if($HTTP_REFERER!=''&&!ereg('searchEngines|otherSitesYouDontCareABOUT',$HTTP_REFERER)){
  if(mysql_num_rows(mysql_query('select * from page_referers where 
page="'.$PHP_SELF.'" and pagereferer="'.$HTTP_REFERER.'"'))<1){
   mysql_query('insert into cj_page_referers set 
page="'.$_PHP_SELF.'",pagereferer="'.$HTTP_REFERER.'"');
   mail($infoemail,"[page referers] $PHP_SELF","$PHP_SELF is linked to 
from $HTTP_REFERER");
  }
}

just place that in a file which is included from every page you want the 
notice on.

the db table is:

CREATE TABLE `page_referers` (
   `id` int(11) NOT NULL auto_increment,
   `page` text,
   `pagereferer` text,
   PRIMARY KEY  (`id`)
) TYPE=MyISAM;

Kae



More information about the thelist mailing list