[Gnomix]
Site Admin

Registrato: 31 Ott 2004
Messaggi: 81
Località: Italy
Status: Offline
|
  Inviato:
02 Dic 2004 - 13:19 |
|
| Oggetto: Come non farsi copiare il sito? |
Salve a tutti,
chiunque abbia un sito in php può utilizzare il seguente script da includere nelle proprie pagine al fine di evitare che alcuni "agent" scarichino il sito.
| Codice:
|
<?php // da un'idea di Gianluca Troiani www.constile.org
$ragni = "ebsite eXtractor,rontPage,ebCopier,ebStripper,
ordermanager, teleport,ndy Library,ebZIP,
FC Foundation Class Library,
http://www.spidersoft.com,TTrack,reaper,webmirror,
offline,WWWOFFLE,strip,MARS_,ripper,
Microsoft URL Control,lwp,libwww,repomonkey,beholder,L
eech,
java,fetch,Telesoft,ru-robot,puf,nothing,webauto,
superbot,cosmos,piripikkio,moxilla,dope fly downloader,
http client,cazz,htdig,wget,website extractor ,www.xtreeme.com,webminer,httrack,py...ark-manager,ull
Web Bot,RLBlaze,roduction Bot,ull web bot 0516,
tar Downloade,turnitinbot";
$ragni = explode(",",$ragni);
$isRagno = 0;
$UA = $_SERVER['HTTP_USER_AGENT'];
for ($i=0;$i<count($ragni) && $isRagno==0;$i++)
if(strpos($UA,$ragni[$i])!==false && strpos($UA,"W3C_Validator")===false && strpos($UA,"Lynx")===false && strpos($UA,"amaya")===false) $isRagno=1;
if ($isRagno==1) {
$fp = @fopen("ragni.txt","r");
$string = fread ($fp, filesize("ragni.txt"))."\n".$UA." : ".date("H:i:s d.m.Y");
fclose($fp);
$fp = @fopen("ragni.txt","w");
fwrite($fp,$string);
fclose($fp);
echo ("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"it\">
<head>
<title>Giochi on-line</title>
</head>
<body>
<p><strong>L'uso degli spider per scaricare le pagine non è consentito</strong>.</p>
<p>Tutte le pagine devono essere visitate singolarmente.</p>
<p>Ciò è stato fatto per
<strong>salvaguardare la banda mensile</strong> del nostro
piano di hosting e <strong>garantire</strong> il più
possibile il <strong>funzionamento regolare</strong> del
sito.</p>
</body>
</html>");
exit();
}
?>
|
Altri suggerimenti per non farsi copiare il sito? utilizzando anche script in perl, C o bash? io avevo pensato di checckare mediante crontab il file di log di httpd... e voi che dite? |
_________________ By [Gnomix] |
|