Nathanael Padgett
  • Facebook
  • Flickr
  • Linkedin
  • Twitter
  • Vimeo
  • Home
  • Photography
    • Portfolio
    • Schedule A Session
    • Packages & Pricing
    • Frequently Asked Questions
  • Web Development Portfolio
  • Contact

Track, Analyze & Block IP Addresses

Home» Programming » Track, Analyze & Block IP Addresses
Track, Analyze & Block IP Addresses

So, you’ve implemented a script to track all those users that are coming to your website and what pages each of them is going to using IP address tracking. Now the fun begins… What reports are you needing to generate to make all the raw data usable?

Let start with a simple report to find out what IP addresses are bogus robots. Yes, there are robots (bots) in cyberspace that go from page to page looking for scripts to exploit (hack). If you have a form on your website, like the site I’m tracking does, you’re much more susceptible to bots roaming your pages trying to find a way of attack.

Step #1: Query your database to get a list of the IP addresses and the number of page views they’ve done:

SELECT ipAddress,count(ipAddress) FROM `trackingTable` GROUP BY ipAddress ORDER BY count(ipAddress) DESC

Here are the top six results that I got back.

Step #2: Look up the IP addresses

I use http://iplocation.net to get an approximate location of where the IP address is located. Note that websites that do IP location lookups are maybe 50% accurate (and that’s on a good day). IP addresses are constantly changing. The first three addresses belong to Microsoft, Google &Yahoo; which are okay and to be expected. The fourth result comes from some hosting company I never heard of; the fifth result comes from somewhere in Russia and the sixth one is another Google IP address.

Step #3: Block Those Who Need To Be!

While I’m not sure why the hosting company IP address is hitting my site so hard; I’m more concerned about an IP address in Russia hitting my site 456 times. Logging into cPanel, I am quickly able to block the IP address from ever contacting my website again. :-)   It’s that simple. — Now, a more ellaborate plan might be to build into the tracking script a email notification system that emails an administrator if an IP address hits your site more than X times a minute. Obviously a physical user browsing your website shouldn’t get above a certain number of pageviews a minute; so it must be a bot then.

Comments are closed.

  • 417-496-6275
  • Nathanael@NathanaelPadgett.com
    • Facebook
    • Twitter
    • Flickr
    • Linkedin
    • Vimeo
    • Email
Subscribe To My Newsletter!

Categories

  • Business (7)
  • Electronics (7)
  • Miscellaneous (4)
  • Photography (16)
  • Photography Page Slider (5)
  • Print/Graphic Design (1)
  • Programming (3)
  • R/C (3)
  • Web Development (11)

Latest Tweets

  • http://t.co/9fbay0KU
  • icontact new dashboard is so company driven - not customer driven; Learn to listen to what customers, not ram stuff down their throats.
  • Church logo intro: http://t.co/0NZGjx99 Unfinished, but still nice.

(c) 2012 Nathanael Padgett