Who's abusing your website?

I wanted to know what IP addresses were hitting my website. I’d done this before and it only took a moment or two to recreate the following commands. Still, here it is for future reference.

grep -v "wp-content" access.log|grep -v wp-includes|cut -f 1 -d " "|sort|uniq -c|sort -nr|less

This code:

  • Excludes “wp-content” and “wp-includes” requests.
  • Uses “cut” to cut out the IP address.
  • Sorts the list of IP addresses.
  • Uses “uniq” to count the occurrence of each IP.
  • And finally reverse sorts the list again, by number of occurrences, with the largest number at the top.

You’ll probably find Google and Yahoo! bots near the top of the list, but I also found the “Jyxobot/1″ bot was quite busy today.


4 Comments

Chris (1 comments.) on July 24, 2010 at 4:53 am.

Hey,

Where do you put this code in a wordpress blog.

Thanks,

Chris

Reply

Donncha (1707 comments.) on July 26, 2010 at 1:36 pm.

You don’t. It’s all bash command line stuff you run from a shell. Nothing to do with WordPress specifically.

Reply

tcd on August 22, 2010 at 9:56 pm.

you might find useful this website:

http://www.commandlinefu.com/commands/browse

it contains a “selection” of bash commands for various purposes.

best regards :)

Reply

Leave Your Comment

Your email will not be published or shared. Required fields are marked *

*

You may 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>


Holy Shmoly! is Stephen Fry proof thanks to caching by WP Super Cache