image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old September 30th, 2005, 05:32 AM
Registered User
 
Join Date: May 2001
Location: Italy
Posts: 243
Thanks: 0
Thanked 0 Times in 0 Posts
Zeus is on a distinguished road
Question Help: I need to 'rate' a text list of IPs

Hi all,
this is a problem i can't resolve. (and i'm quite sure ya can ;-) )

I'm running an ftp server and now i've detected someone is trying to brute-forcing it.
I want to do something cause i really can't shutdown the ftp service and my ip is static.

So, 'grep'ing and 'awk'ing log files i've get a list of attacking ips.
Now i'd like to extract from this list all IP repeated for more than 10 times.

i really have no idea on how to do it.
Please, is there any one can help me ?

Thanks in advance

Last edited by Zeus; September 30th, 2005 at 05:40 AM.
Reply With Quote
  #2  
Old September 30th, 2005, 07:46 AM
lurk's Avatar
Mitä?
 
Join Date: Mar 2002
Location: Land o' skeeterz
Posts: 2,076
Thanks: 0
Thanked 0 Times in 0 Posts
lurk is on a distinguished road
You want to pipe the list through uniq -c that will print out each unique line with the number of times it has been seen. Then pipe it through sort -n to sort the list numerically. Now you can just read them off in order. If you really want to sort out those less than 10 you can make a quick awk script for that.

Good Luck!
Reply With Quote
  #3  
Old September 30th, 2005, 11:43 AM
Registered User
 
Join Date: May 2001
Location: Italy
Posts: 243
Thanks: 0
Thanked 0 Times in 0 Posts
Zeus is on a distinguished road
ok ... i'm just working with it !!

thanks for fast reply !
__________________
Zeus
(filippo_zeus <at> tin <dot> it)
----------------
iBook G4 1000, 768 Ram, 40 Gb
(OSx 10.3.9 and OSx 10.4.2)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 01:35 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.