DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th August 2008
bichumo bichumo is offline
Port Guard
 
Join Date: May 2008
Posts: 21
Default Collect visited sites

Hi,

Is there any way to collect the most visited sites by users? I think I could write some script to analyze tcpdump output, but maybe there are any ready to go tools?

Thanks.
Reply With Quote
  #2   (View Single Post)  
Old 8th August 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

Can you be a little more specific? What OS/version? Are you acting as a gateway? A squid proxy?
__________________
Kill your t.v.
Reply With Quote
  #3   (View Single Post)  
Old 8th August 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

not very scientific but maybe:

Code:
#!/usr/local/bin/perl
# --ephemera

$netif='em0';
$nsites=10;
$updateSecs=10;
open TDMP, "tcpdump -lnni $netif 'dst port 53' |" or die "$!\n";
while(<TDMP>) {
	if (/ A\? ([A-z](?:[\w-]+\.)+[\w-]+[\w])\. /) {
		$m{$1}++;
		if (time - $t >= $updateSecs) {
			$t = time;
			print "\nTop $nsites sites as of ", scalar localtime $t, ":\n\n";
			@s = sort {$m{$b} <=> $m{$a}} keys %m;
			for (0..$nsites-1) { print "\t",$_+1,". $s[$_]\n";}
		}
           }
}

Last edited by ephemera; 9th August 2008 at 08:40 PM.
Reply With Quote
  #4   (View Single Post)  
Old 8th August 2008
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Default

If you use BASE with Snort, you can have snort filter specifically for web traffic, then BASE can automatically and nicely sort the address hits. And since BASE is a web app, it's actually pretty easy to use.
__________________
Network Firefighter
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Way to sync web sites roundkat OpenBSD General 2 14th September 2008 01:48 PM
Cool sites 18Googol2 Off-Topic 0 2nd May 2008 09:19 AM


All times are GMT. The time now is 02:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick