Skip to content Skip to content


How to determine which IP addresses are hitting your web site the most Kā noteikt, kuras IP adreses ir hitting jūsu tīmekļa vietni visbiežāk

Security

This is a brief one. Šis ir īss vienu. Thanks to Paldies The How-To Geek How-To Geek for bringing this command into my troubleshooting repertoire. noteikts, lai šī komanda manā traucējummeklēšanu repertuāru.

A bit of background first. Fona bit pirmās. This command is helpful to determine who is causing the most hits to your web site. Šī komanda ir noderīga, lai noteiktu, kas izraisa visvairāk apmeklētāju jūsu mājas lapā. On my music blog, I post a fair number of (totally legal) MP3s. Par manu mūziku blog, I post taisnīgu skaits (kopā juridiskā) 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). Dažas mazāk nekā ētikas cilvēki bieži lieto šos MP3s, lai plūsma caur viņu vietā, izraisot raktuves ir lēnāks (un lielāka platjoslas rēķinu). 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. Ko norādītas, IP adresi site / personu "zādzības" mans joslas platums es tad var bloķēt to IP piekļūtu jebkuru manu saturu.

Note: you'll need shell access to your web server log files Piezīme: Jums vajadzēs apvalks piekļuvi jūsu tīmekļa servera log faili

  1. SSH (or telnet) to your web host. SSH (vai telnet) uz jūsu Web Host. Switch to the directory that stores your web server log files. Pārslēgties uz direktoriju, kur glabājas tīmekļa servera log failus.
  2. Run this command: Palaist šo komandu:

    tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n tail -100,000 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. kur 100,000 ir līniju skaitu (sākot no beigām log fails), jūs vēlaties meklēt, un access.log ir nosaukums jūsu tīmekļa servera pieejas reģistrā.

  3. termināļa ar asti awk uniq kārtošanas rezultāti

  4. The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. Rezultātā būs (iespējams) diezgan garu sarakstu ar IP, sakārtoti pēc vismazāk hits, kas visvairāk. 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). Pirmā vērtība katrā rindā ir vairākkārt IP adrese (otrais numurs) piekļūt jūsu vietnes (jo skaits līniju log failu precizēts).

    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). Izmantojiet uzņēmējas komandu, lai noteiktu, pilnībā kvalificētu domēna vārdu par jebkuru IP adresi, kas rāda uz augšu (jūs droši vien vēlaties zināt, kas tie, kas skāra vietnes lielākā daļa). In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. In screenshot piemēru zemāk, divas IP, kas skāra simplehelp.net visvairāk bija Googlebot un Yahoo Site Kāpurķēžu.

  5. termināļa ar asti awk uniq sort

  6. If there's an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: Ja tur ir IP / domain, ka izskatās aizdomīgs, jūs varat pārbaudīt, kuri faili viņi dodas, izmantojot komandu:

    tail -1000 access.log | grep xx.xx.xx.xx tail -1.000 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. Šīs komandas, 1000 ir līniju skaitu, lai pārbaudītu, access.log ir nosaukums jūsu tīmekļa servera pieejas žurnālu, un xx.xx.xx.xx ir IP vēlaties kārtot. 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. I'd iesakām izmantot mazāku skaitu (1000 vs 100.000 ko lieto pirmo komandu), kā jūs, iespējams, nav vajadzīgs / gribam redzēt visiem failu tie pieejami. If you do, increase the 1000 number. Ja jūs palielināt 1.000 numuru. 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. Vai, ja nav ļoti daudz rezultāti rāda uz augšu, tas nozīmē, ka viņi dodas sava vieta "agrāk" un jūs vēlaties, lai palielinātu 1000 līdz lielākajam skaitlim.

Posted in Posted in Security Security . .

Related Posts: Related Posts:

Why you get email that isn't addressed to you Kāpēc jums e-pastu, kas nav domāts jums
How to use vMailias to generate unique email addresses for easy sorting and filtering Kā lietot vMailias, lai radītu unikālu e-pasta adreses viegli šķirošana un filtrēšana
How to secure your wireless home network Kā nodrošināt bezvadu mājas tīkls
Some useful Linux bash tricks Daži noderīgi Linux bash tricks
How to determine the number of times your site has been bookmarked on del.icou.us Kā noteikt, cik reizes jūsu vieta ir grāmatzīmi uz del.icou.us

3 Responses 3 Atbildes

Stay in touch with the conversation, subscribe to the Uzturēt kontaktus ar sarunu, abonēt RSS feed for comments on this post RSS barību komentārus par šo ziņu . .

  1. Tony Tony says saka

    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. Problēma ir tā, ka, ja kāds hotlinks jūsu MP3 (vai attēlus vai citus masu saziņas līdzekļus), tad tas vēl par to lietotāju IP, kas parādās jūsu žurnālus, nevis pārkāpēju tīmekļa servera. 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). Proti, tas droši vien būs diezgan vienmērīgi sadalītos, lietotāju un atšķirama no jūsu likumīgās apmeklētāju (ja vien kāds ir tikai nepārtraukti papildināt savu multivides saturu).

    What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list). Ko jūs vēlaties darīt, ir pārbaudīt, lai referrer informācija, multivides failus, (protams izņemot savu domēnu no saraksta).

  2. Ross Ross says saka

    Tony - Tony --

    Under normal circumstances yes, you're absolutely right. Normālos apstākļos jā, tev pilnīga taisnība. 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. Manā konkrētajā gadījumā, vieta bija kravas failus caur flash player, ka tie notika, un visi lūgumi tika saņemti no vietām 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. Pievienojot IP ir mana. Htaccess savukārt pārtrauca flash player no iekraušanas ikvienam dziesmas / visiem, kas centās spēlēt tos no * explatives * site.

  3. miiimooo says miiimooo saka

    لم افهم شي لم افهم شي



Some HTML is OK Daži HTML ir OK

or, reply to this post via vai, atbildot uz šo ziņu izmantojot trackback Trackback . .