Bueno estabamos en el msn.. mi amigo y yo y cogimos el codigo
de google y nos basamos en mejorar el codigo hasta hacerlo, en un "AvisaBot".
gracias a VirtuD por la ayuda, que no fue poca, y para OCEANIK


Funciones:

Envia Mails cuando un Robot Visita su Web

Robots Incluidos:

Google
AltaVista
Alltheweb
Lycos
Ask Jeeves
Teoma
Inktomi




include ("notificator.php")

Código: Seleccionar todo

<?PHP
## Para Insertar en las Paginas es  include ("notificator.php")

## Manda Email cuando los robots de abajo visitan la web
## Googlebot - [Google] - www.google.com
## Alta Vita - [Scooter] - www.altavista.com
## Teoma - [Ask Jeeves/Teoma] - ww.teoma.com
## Ask - [Ask Jeeves/Teoma] - www.ask.com
## Lycos - [Lycos_Spider_(T-Rex)] - www.lycos.com
## Inktomi - [Slurp] - www.inktomi.com
## Mirago - [HenryTheMiragorobot] - www.mirago.com
## AlltheWeb - [FAST-WebCrawler] - www.alltheweb.com

############## Configuracion de Mail#############
## Cambiar lo que necesita 
$email = ""; ## Aca el Email
$email = preg_replace("/[\n\r]+/", "", "$email");
############## Fin de la Config #############

$pie = "------------------------------------------------------------------------------
By Virtux - Para DiosDeLaRed /DDLR
------------------------------------------------------------------------------";
$dia = date("F j, Y, g:i a"); ## Toma el Tiempo de cuando entro el Robot
$header = "-----------------------------------------------------------------------------
              Un Bot ha Visitado Su Web
-----------------------------------------------------------------------------";
##  Google	
 if(eregi("Googlebot",$HTTP_USER_AGENT)) {
 global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$GoogleLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$GoogleLink = "http://".$SERVER_NAME.$PHP_SELF;} 

$GoogleEmail = "
".$header."
Hola,
El Robot GoogleBot ha visitado su sitio http://$SERVER_NAME . Desde ya, muchas gracias por usar nuestro sistema 

GoogleBot registro su pagina ".$GoogleLink."
Hora de Visita - ".$dia."

Pagina del Buscador: http://www.google.com
".$pie."
";
	      @mail("$email", "GoogleBot entro a su Web!", $GoogleEmail, "From: <Google Robot>$email");		  
   }
##	ALTAVISTA 
 if(eregi("Scooter",$HTTP_USER_AGENT)) {
  global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$AVLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$AVLink = "http://".$SERVER_NAME.$PHP_SELF;} 
$AVEmail = "
".$header."
Holitas,
El Robot Scooter , ha sido detectado en su pagina http://$SERVER_NAME 

Scooter registro su pagina ".$AVLink."
Fecha - ".$dia."

Buscador Link: http://www.altavista.com
".$pie."
";
	      @mail("$email", "AltaVista Entro a su Web", $AVEmail, "From: <Alta Vista>$email");		  
  }
## All The Web
 if(eregi("FAST-WebCrawler",$HTTP_USER_AGENT)) {
  global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$FASTLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$FASTLink = "http://".$SERVER_NAME.$PHP_SELF;} 
$FASTEmail = "
".$header."
Holaa,
Encontramos el Robot FAST-WebCrawler en su web, estimamos que registro su web http://$SERVER_NAME

Registro su pagina ".$FASTLink."
Fecha - ".$dia."

Buscador Link: http://www.alltheweb.com
".$pie."
";
	      @mail("$email", "AllTheWeb Visito Su Web", $FASTEmail, "From: <FAST Robot>$email");		  
  }		  		  		 		  		  		  		  
## Ask Jeeves		  		  		  		  
 if(eregi("Ask Jeeves/Teoma",$HTTP_USER_AGENT)) {
  global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$ASKLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$ASKLink = "http://".$SERVER_NAME.$PHP_SELF;} 
$ASKEmail = "
".$header."
Hola,
Detectamos el Robot Ask Jeeves/Teoma en la siguiente web http://$SERVER_NAME

Registro su web ".$ASKLink."
Fecha - ".$dia."

Buscador Link: http://www.ask.com & http://www.teoma.com
".$pie."
";
	      @mail("$email", "Ask Jeeves-Teoma Visito Su Web", $ASKEmail, "From: <ASK/Teoma Robot>$email");		  
  }
 ## Inktomi
  if(eregi("Slurp",$HTTP_USER_AGENT)) {
   global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$SLURPLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$SLURPLink = "http://".$SERVER_NAME.$PHP_SELF;} 
$SLURPEmail = "
".$header."
Hola,
El robot Slurp Se detecto en su web http://$SERVER_NAME

Regsitro su pagina ".$SLURPLink."
Fecha - ".$dia."

Buscador Link: http://www.inktomi.com
".$pie."
";
	      @mail("$email", "Inktomi Robot Visito Su Web", $SLURPEmail, "From: <Inktomi Robot>$email");		  
  }
##  MIRAGO 
   if(eregi("HenryTheMiragorobot",$HTTP_USER_AGENT)) {
    global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$MiragoLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$MiragoLink = "http://".$SERVER_NAME.$PHP_SELF;} 
$MiragoEmail = "
".$header."
Hola,
Detectamos el Robot HenryTheMiragorobot en su Web http://$SERVER_NAME

Registro Su Web ".$MiragoLink."
Fecha - ".$dia."

Buscador Link: http://www.mirago.com
".$pie."
";
	      @mail("$email", "Mirago Robot Visito Su Web", $MiragoEmail, "From: <Mirago Robot>$email");		  
  }
##  LYCOS 
   if(eregi("Lycos_Spider_(T-Rex)",$HTTP_USER_AGENT)) {
    global $header;
 global $pie;
 global $dia;
  if ($QUERY_STRING != "")  {$LycosLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}
else  {$LycosLink = "http://".$SERVER_NAME.$PHP_SELF;} 
$LycosEmail = "
".$header."
Hola,
Detectamos al Lycos_Spider_(T-Rex) en su web http://$SERVER_NAME

Registro su Web ".$LycosLink."
Fecha - ".$dia."

Buscador Link: http://www.lycos.com
".$pie."
";
	      @mail("$email", "Lycos Robot Visito Su Web", $LycosEmail, "From: <Lycos Robot>$email");		  
  }

?>

Saludos!
Muy útil! normalmente hasta que no se hace una revisión de las consultas que se realizan dentro de los logs no se encuentran estos problemas... me lo guardo! jej

Saludos bro
No importa cuan rápida y avanzada sea la tecnología, la mente humana aún es el procesador más versátil y creativo que hay.
También quien quiera modificarlo más podeis modificar el code y lo podemos simplificar bastante creando una sola funcion para enviar los datos.



Saludos y gracias por el comentario! :)
Qué bueno Skillmax! Como dice 4n0ny muy útil!
Puede que le haga alguna mod para almacenar en un txt la info de los bots visitantes

Thanks!!
Imagen

"Be the change you want to see in the world"
rdnmlln escribió:Qué bueno Skillmax! Como dice 4n0ny muy útil!
Puede que le haga alguna mod para almacenar en un txt la info de los bots visitantes

Thanks!!

De nada bro..



Un saludo amigo!
En versiones nuevas ereg y eregi están obsoletas a partir de PHP 5.3.0, ¿sabes de alguna similar para el caso?

Saludos!

Edit/

stripos
No importa cuan rápida y avanzada sea la tecnología, la mente humana aún es el procesador más versátil y creativo que hay.
Aca lo optimizé un poco...

Código: Seleccionar todo

<?PHP
## Para Insertar en las Paginas es  include ("notificator.php")

## Manda Email cuando los robots de abajo visitan la web
## Googlebot - [Google] - www.google.com
## Alta Vita - [Scooter] - www.altavista.com
## Teoma - [Ask Jeeves/Teoma] - ww.teoma.com
## Ask - [Ask Jeeves/Teoma] - www.ask.com
## Lycos - [Lycos_Spider_(T-Rex)] - www.lycos.com
## Inktomi - [Slurp] - www.inktomi.com
## Mirago - [HenryTheMiragorobot] - www.mirago.com
## AlltheWeb - [FAST-WebCrawler] - www.alltheweb.com

############## Configuracion de Mail#############
## Cambiar lo que necesita
$email = ""; ## Aca el Email
$email = preg_replace("/[\n\r]+/", "", "$email");
############## Fin de la Config #############

$pie = "------------------------------------------------------------------------------
By Virtux - Para DiosDeLaRed /DDLR
------------------------------------------------------------------------------";
$dia = date("F j, Y, g:i a"); ## Toma el Tiempo de cuando entro el Robot
$header = "-----------------------------------------------------------------------------
              Un Bot ha Visitado Su Web
-----------------------------------------------------------------------------";
############################
#->Parte modificada por linkgl
//ARRAYS CON LOS BOTSS
$bots = array('Googlebot','Scooter','FAST-WebCrawler','Ask Jeeves/Teoma','Slurp','HenryTheMiragorobot','Lycos_Spider_(T-Rex)');
//Chequeo
for($i=0;$i<count($bots);$i++)
{
  //SI EL BOT ESTA EN LA WEB
  if(eregi($bots[$i],$HTTP_USER_AGENT))
  {
    if ($QUERY_STRING != "")
    {
      //obtenemos lo indexado
      $GoogleLink = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;
    }
    else 
    {
      //obtenemos la pag principal
      $GoogleLink = "http://".$SERVER_NAME.$PHP_SELF;
    }
    $GoogleEmail = $header."Hola, El Robot ".$bots[$i]." ha visitado su sitio http://$SERVER_NAME . Desde ya, muchas gracias por usar nuestro sistema".$bots[$i]." registro su pagina ".$GoogleLink."Hora de Visita - ".$dia."".$pie;
    @mail("$email", $bots[$i] . " entro a su Web!", $GoogleEmail, "From: <".$bots[$i].">$email");       
  }
}
#<- fin

?>
Edito--
Para almacenar en un txt basta reemplazar la función mail, por la apertura y escritura del archivo, también se puede utilizar foreach para evitar un parametro en el for...
//mHmm..
De lujo señores!
No importa cuan rápida y avanzada sea la tecnología, la mente humana aún es el procesador más versátil y creativo que hay.
Buenissimo SkillmaX que decir,esto me tumba a mi de bueno...

Salu2
Blog técnico dedicado a la seguridad informática y al estudio de nuevas vulnerabilidades.
Blog: http://www.seginformatica.net
Twitter: https://twitter.com/#!/p0is0nseginf
Responder

Volver a “Auditoria Web”