Detonando robots!
A muito tempo tempo se fala dos "Google hacks", mas o que não é divulgado é como evitar que o Google e outros sistemas de busca disponibilizem informações e/ou arquivos que não sejam interessantes para seu site.
Parte 2: Bloqueando robots
1° - Firewall
Pelos logs você pode bloquear direto no firewall.
Lista com agentes/IP:
2° - Por agente
Os robots usam agentes com nomes específicos, assim pode criar-se uma regra para bloqueá-los.
a) Via ".htaccess":
SetEnvIfNoCase User-Agent "^EmailSiphon" bot
SetEnvIfNoCase User-Agent "^EmailWolf" bot
SetEnvIfNoCase User-Agent "^ExtractorPro" bot
SetEnvIfNoCase User-Agent "^CherryPicker" bot
SetEnvIfNoCase User-Agent "^NICErsPRO" bot
SetEnvIfNoCase User-Agent "^Teleport" bot
SetEnvIfNoCase User-Agent "^EmailCollector" bot
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=bot
</Limit>
SetEnvIfNoCase User-Agent "^EmailWolf" bot
SetEnvIfNoCase User-Agent "^ExtractorPro" bot
SetEnvIfNoCase User-Agent "^CherryPicker" bot
SetEnvIfNoCase User-Agent "^NICErsPRO" bot
SetEnvIfNoCase User-Agent "^Teleport" bot
SetEnvIfNoCase User-Agent "^EmailCollector" bot
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=bot
</Limit>
Lista de agentes, várias aplicações:
b) Via robots.txt:
Você pode criar uma arquivo chamado "robots.txt" no diretório raiz do seu site. Esse arquivo é usado para bloquear agentes em um diretório único.
Bloqueando acesso a todo site:
# vim /robots.txt
User-agent: *
Disallow: /
Disallow: /
Bloqueando um agente específico:
# vim /robots.txt
User-agent: webcrawler
Disallow:
Disallow:
Bloqueando Google Images:
# vim /robots.txt
# Robot do Goolge images
User-Agent: Googlebot-Image
Disallow: /
User-Agent: Googlebot-Image
Disallow: /
Mais informações sobre o Google-Bot:
Alguns diretórios interessantes:
# vim /robots.txt
User-agent: *
Disallow: /cgi-bin/
Disallow: /_borders/
Disallow: /_derived/
Disallow: /_fpclass/
Disallow: /_overlay/
Disallow: /_private/
Disallow: /_themes/
Disallow: /_vti_bin/
Disallow: /_vti_cnf/
Disallow: /_vti_log/
Disallow: /_vti_map/
Disallow: /_vti_pvt/
Disallow: /_vti_txt/
Disallow: /cgi-bin/
Disallow: /_borders/
Disallow: /_derived/
Disallow: /_fpclass/
Disallow: /_overlay/
Disallow: /_private/
Disallow: /_themes/
Disallow: /_vti_bin/
Disallow: /_vti_cnf/
Disallow: /_vti_log/
Disallow: /_vti_map/
Disallow: /_vti_pvt/
Disallow: /_vti_txt/
Exemplos de robots.txt:
- http://www.whitehouse.gov/robots.txt
- http://www.google.com/robots.txt
- http://www.ibm.com/robots.txt
- http://www.cnn.com/robots.txt
- http://www.nytimes.com/robots.txt
- http://www.w3.org/robots.txt
- http://www.amazon.com/robots.txt
3° - Bloqueando por META tags
É possível utilizar as meta tags para dizer ao Robot para não indexar ou seguir os links em uma de página. Para isso adicione as tags abaixo no cabeçalho das páginas que quiser bloquear. É claro que esse método só funciona para Robots "legais" e as tags precisam ser adicionadas em cada página que quiser bloquear.
Entre as tags <head></head> insira:
Todos Robots:
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
Para não arquivar sua página(cache):
<META NAME="ROBOTS" CONTENT="NOARCHIVE">
Para o Google:
<META NAME="GOOGLEBOT" CONTENT="NOINDEX, NOFOLLOW">
Para não aparecer a keyword em negrito na busca:
<META NAME="GOOGLEBOT" CONTENT="NOSNIPPET">
Cache do Google:
<META NAME="GOOGLEBOT" CONTENT="NOARCHIVE">
Muito legal seu artigo, trouxe a luz uma fissura na segurança pessoal desconhecida por muitos!
[]'s