How to determine which IP addresses are hitting your web site the most Cómo determinar qué direcciones IP están golpeando su sitio web la mayoría de

by Ross McKillop on October 7, 2008 por Ross McKillop el 7 de octubre, 2008

Seguridad

This is a brief one. Este es un breve uno. Thanks to Gracias a The How-To Geek El cómo-a geek for bringing this command into my troubleshooting repertoire. para lograr este comando la solución de problemas en mi repertorio.

A bit of background first. Un poco de antecedentes en primer lugar. This command is helpful to determine who is causing the most hits to your web site. Este comando es útil para determinar que está causando la mayoría de visitas a su sitio web. On my music blog, I post a fair number of (totally legal) MP3s. En mi blog de música, he puesto un buen número de (totalmente legal) MP3. Some less than ethical people often use those MP3s to stream via their site, causing mine to be slower (and a larger bandwidth bill). Algunos menos de ética personas suelen utilizar los MP3s para transmitir a través de su sitio, causando las minas a ser más lenta (y un proyecto de ley más amplio ancho de banda). By figuring out the IP address of the site/person “stealing” my bandwidth I can then block their IP from accessing any of my content. Por averiguar la dirección IP del sitio / persona "robar" mi ancho de banda que puede bloquear su acceso a la propiedad intelectual de cualquiera de mis contenidos.

Note: you’ll need shell access to your web server log files Nota: tendrás acceso shell a su servidor web los archivos de registro

  1. SSH (or telnet) to your web host. SSH (o telnet) para su web host. Switch to the directory that stores your web server log files. Cambie al directorio que almacena su servidor web los archivos de registro.
  2. Run this command: Ejecutar este comando:

    tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n -100.000 cola access.log | awk '(print $ 1)' | sort | uniq-c | sort-n

    where 100000 is the number of lines (starting from the end of the log file) you want to search, and access.log is the name of your web server access log. donde 100000 es el número de líneas (a partir del final del archivo de registro) que desea buscar, y access.log es el nombre de su servidor web de registro de acceso.

  3. terminal con cola awk uniq ordenar los resultados

  4. The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. El resultado será una (probablemente) bastante larga lista de direcciones IP, ordenada por el menor número de visitas a la mayoría. The first value in each row is the number of times the IP address (the second number) accessed your site (in the number of lines of the log file you specified). El primer valor en cada fila es el número de veces que la dirección IP (el segundo número) acceder a su sitio web (en el número de líneas del archivo de registro que se especifique lo contrario).

    Use the host command to determine the fully qualified domain name of any IP address that shows up (you’ll probably want to know who the ones that hit your site the most are). Utilice el comando host para determinar el nombre de dominio completo de cualquier dirección IP que se muestra (usted probablemente querrá saber quiénes son los afectados los que su sitio son los más). In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. En la captura de pantalla siguiente ejemplo, dos de los proyectos de investigación que afectó a la mayoría de simplehelp.net se Googlebot y el rastreador del sitio Yahoo.

  5. terminal con cola awk uniq tipo

  6. If there’s an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: Si hay una IP / dominio que parece sospechoso, usted puede verificar para ver que archivos son por golpear con el comando:

    tail -1000 access.log | grep xx.xx.xx.xx -1.000 cola access.log | grep xx.xx.xx.xx

    In that command, 1000 is the number of lines to check, access.log is the name of your web server access log, and xx.xx.xx.xx is the IP you want to sort by. En este comando, 1000 es el número de líneas para comprobar, access.log es el nombre de su servidor web de registro de acceso, y xx.xx.xx.xx es la IP que desea ordenar. I’d suggest using a smaller number (1000 vs. 100000 as used in the first command) as you probably don’t need/want to see every file they accessed. Yo sugiero utilizar un menor número (1000 frente a 100.000, tal como se utiliza en el primer comando), como usted probablemente no necesita / quiere ver todos los archivos que acceder a ella. If you do, increase the 1000 number. Si lo hace, aumentar el número 1000. Or, if not very many results show up, that means that they were hitting your site “earlier”, and you’ll want to increase 1000 to a higher number. O, si no muchos se muestran los resultados, lo que significa que estaban golpeando a su sitio "antes", y que usted desea aumentar de 1000 a un mayor número.

Related Posts: Puestos relacionados con:
  • Why you get email that isn’t addressed to you ¿Por qué usted recibe el correo electrónico que no está dirigida a usted
  • How to use vMailias to generate unique email addresses for easy sorting and filtering Cómo utilizar vMailias única para generar direcciones de correo electrónico para facilitar la clasificación y filtrado
  • How to secure your wireless home network ¿Cómo asegurar tu red inalámbrica doméstica
  • How to transfer Outlook auto-complete addresses to a new computer Cómo transferir Outlook auto-completar las direcciones a un equipo nuevo
  • Joost Invites Invita a Joost
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Get Simple tutoriales de ayuda al igual que este un mensaje de correo electrónico en su bandeja de entrada cada día - para libre! Just enter your email address below: Sólo tienes que introducir tu dirección de correo electrónico a continuación:

    You can always opt out of this email subscription at any time. Usted siempre puede optar por salir de este mensaje de correo electrónico de suscripción en cualquier momento.


    Bookmark and Share Favoritos y Compartir

    { 2 comments… read them below or (2 comentarios ... leer a continuación o add one añadir un } )

    1 1 Tony Tony 10.07.08 at 2:58 pm 10.07.08 a 2:58 pm

    The problem is that if someone hotlinks your mp3s (or images, or any other media), then it’s still the IPs of their users that will show up in your logs, not the offending webserver. El problema es que si alguien enlaces tu mp3 (o imágenes, o cualquier otro medio de comunicación), entonces es todavía la IP de sus usuarios que se mostrará en su registros, no ofender a la web. That is to say, it will likely be a fairly even distribution of users and indistinguishable from that of your legitimate visitors (unless someone is just continuously refreshing your media content). Es decir, que probablemente será una distribución equitativa de los usuarios y distinguir de que de su legítimo visitantes (a menos que alguien se acaba de actualizar continuamente los medios de comunicación de su contenido).

    What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list). Lo que quieren hacer es la comprobación de la información de referencia a los archivos multimedia (excluyendo, naturalmente, su propio dominio de la lista).

    2 2 Ross Ross 10.07.08 at 3:05 pm 10.07.08 a 3:05 pm

    Tony - Tony --

    Under normal circumstances yes, you’re absolutely right. En circunstancias normales, sí, estás absolutamente en lo cierto. In my specific case, the site was loading the files via a flash player that they hosted, and all the requests came from the sites flash player. En mi caso concreto, el sitio se carga los archivos a través de un flash player que acogió, y todas las solicitudes procedían de los sitios flash player. Adding the IP to my .htaccess in turn stopped the flash player from loading the songs for anyone/everyone who tried to play them from the *explatives* site. Agregar el período de investigación para mi. Htaccess, a su vez, detuvo el flash player de carga de las canciones para nadie / todos los que trataron de jugar desde el explatives * * sitio.

    Leave a Comment Déjanos tu comentario

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Puede utilizar estas etiquetas HTML y atributos: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>