Skip to content Skip सामग्री के लिए


How to determine which IP addresses are hitting your web site the most कैसे जो IP पते निर्धारित करने के लिए अपने वेब साइट मार रहे हो सबसे अधिक

सुरक्षा

This is a brief one. यह एक संक्षिप्त एक है. Thanks to धन्यवाद के लिए The How-To Geek कैसे करने के लिए geek - for bringing this command into my troubleshooting repertoire. मेरी समस्या निवारण के लिए सूची में इस आदेश लाने.

A bit of background first. पृष्ठभूमि का एक सा पहले. This command is helpful to determine who is causing the most hits to your web site. इस कमान के लिए निर्धारित है जो अपने वेब साइट के लिए सबसे हिट खड़ी कर रहा है सहायक है. On my music blog, I post a fair number of (totally legal) MP3s. मेरे संगीत ब्लॉग पर, मैं MP3s (पूरी तरह से कानूनी) के एक उचित संख्या के बाद. Some less than ethical people often use those MP3s to stream via their site, causing mine to be slower (and a larger bandwidth bill). कम नैतिक लोगों से कुछ अक्सर अपनी साइट के माध्यम धारा उन MP3s उपयोग करते हैं, जिससे मेरी (और एक बड़ा बैंडविड्थ बिल जा सकता है) धीमी है. 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. द्वारा स्थल का आईपी पता / व्यक्ति "चोरी" मेरा बैंडविड्थ मैं तो अपने सामग्री के किसी भी पहुँचने से अपने आईपी ब्लॉक कर सकते हैं लगाना.

Note: you'll need shell access to your web server log files नोट: आप अपने वेब सर्वर लॉग इन फ़ाइलों को खोल उपयोग की आवश्यकता होगी

  1. SSH (or telnet) to your web host. Ssh अपने वेब की मेजबानी के लिए (या telnet). Switch to the directory that stores your web server log files. निर्देशिका में स्विच कि स्टोर अपने वेब सर्वर लॉग फाइल.
  2. Run this command: यह कमांड चलाएँ:

    tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n पूंछ -100,000 access.log | 'awk ($ 1) प्रिंट' | तरह | uniq-c | प्रकार-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. जहां 100000 लाइनों की संख्या (लॉग फ़ाइल के अंत से शुरू) को आप खोज करना चाहते हैं, और access.log है अपने वेब सर्वर का उपयोग प्रवेश के नाम है.

  3. पूंछ awk uniq तरह के परिणामों के साथ टर्मिनल

  4. The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. परिणामस्वरूप एक शायद (है) काफी आईपी की लंबी सूची, सबसे fewest हिट द्वारा हल होगा. 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). प्रत्येक पंक्ति में पहली बार मूल्य आईपी पता (दूसरे नंबर) का नंबर है आपकी साइट पर उपलब्ध है (लॉग फ़ाइल आपके द्वारा निर्दिष्ट की लाइनों की संख्या में).

    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). मेजबान कमांड का प्रयोग किसी भी आईपी पते का पूरी तरह से योग्य डोमेन नाम तय करने से पता चलता है कि अप (आप शायद जो कि लोगों को अपनी साइट पर सबसे हिट हैं जानना चाहता हूँ) हूँ. In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. नीचे स्क्रीनशॉट उदाहरण में, आईपी कि हिट simplehelp.net के दो सबसे गूगल और याहू साइट क्रॉलर थे.

  5. पूंछ awk के साथ टर्मिनल uniq तरह

  6. If there's an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: यदि वहाँ एक आईपी डोमेन / लगता है कि शक है, तो आप जो देख वे आदेश का उपयोग करके मार रहे थे फाइलों की जांच कर सकते हैं:

    tail -1000 access.log | grep xx.xx.xx.xx पूंछ -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. उस आदेश में, 1000 लाइनों की संख्या की जाँच है, access.log अपने वेब सर्वर का उपयोग प्रवेश के नाम पर है, और xx.xx.xx.xx आईपी से आप क्रमित करना चाहते हैं. 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. मैं एक छोटी संख्या का प्रयोग सुझाव (1000 बनाम 100000 के रूप में पहली कमांड में प्रयुक्त) के रूप में तुम्हें शायद जरूरत नहीं है / यह देखने के हर फाइल वे पहुँचा चाहता हूँ. If you do, increase the 1000 number. यदि आप, 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. या, नहीं तो बहुत सारे परिणामों को दिखाने के लिए, इसका मतलब है कि वे आपकी साइट के "पहले" मार रहे थे, और तुम एक उच्च संख्या 1000 बढ़ाना चाहती हूँ.

Posted in पोस्ट में Security सुरक्षा . .

Get Simple Help tutorials just like this one in your email inbox every day - for free! बस अपने ईमेल इनबॉक्स के लिए मुफ्त हर दिन - में यह एक तरह सरल सहायता ट्यूटोरियल जाओ! Just enter your email address below: बस नीचे अपना ईमेल पता दर्ज करें:

You can always opt out of this email subscription at any time. तुम हमेशा इस ईमेल सदस्यता से बाहर किसी भी समय विकल्प चुन सकते हैं.

3 Responses 3 जवाब

Stay in touch with the conversation, subscribe to the बातचीत के साथ संपर्क में रहो, की सदस्यता लें RSS feed for comments on this post आरएसएस के इस पोस्ट पर टिप्पणियों के लिए फ़ीड . .

  1. Tony टोनी says कहते हैं,

    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. समस्या यह है कि यदि कोई अपने mp3s (या चित्र, या अन्य किसी मीडिया) है, तो यह अभी भी अपने उपयोगकर्ताओं के आईपी, कि अपनी लॉग में दिखाएगा नहीं अपमानजनक वेबसर्वर है hotlinks. 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). यह कहना है, यह संभावना काफी प्रयोक्ताओं और अविवेच्य के भी अपने वैध आगंतुकों की है कि वितरण से होगा (जब तक कोई बस लगातार अपने मीडिया सामग्री ताज़ा है).

    What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list). क्या आप चाहते हैं कि आपकी मीडिया फ़ाइलों के लिए संदर्भ जानकारी के लिए जाँच कर रही हो (स्वाभाविक रूप से सूची में से अपने डोमेन को छोड़कर).

  2. Ross रॉस says कहते हैं,

    Tony - टोनी --

    Under normal circumstances yes, you're absolutely right. सामान्य परिस्थितियों में हाँ, तुम बिल्कुल सही हो. 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. अपने विशिष्ट मामले में, एक साइट फ़्लैश प्लेयर है कि वे मेजबानी के जरिए फाइल लोड हो रहा था, और सभी अनुरोधों साइटों से आए खिलाड़ी फ़्लैश. 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. बदले में मेरी htaccess. आईपी को जोड़ने के लिए किसी के लिए भी गाने लोड करने से फ़्लैश प्लेयर बंद कर दिया / सभी को, जो उन्हें explatives * * साइट से खेलने की कोशिश की.

  3. miiimooo says miiimooo कहते हैं,

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



Some HTML is OK कुछ HTML है ठीक है

or, reply to this post via या, इस पोस्ट के माध्यम से जवाब trackback Trackback . .