tcpdump mailing list archives

Re: Running TCPDUMP over a web interface


From: Aaron Turner <synfinatic () gmail com>
Date: Sun, 18 Sep 2011 10:01:34 -0700

On Sun, Sep 18, 2011 at 9:13 AM, harish badrinath
<harishbadrinath () gmail com> wrote:
On Sep 17, 2011, at 1:54 AM, Tek Bahadur Limbu wrote:

Can you provide further information about how we can go about
implementing this setup?


These are the steps i would follow
(a) First look for a MVC web framework for the language of your choice
If you end up with goahead or microhttpd you would be left with C or
Something like that,
so look for CGIC or a library with similar/more functionality.
(b) Build the UI in HTML+CSS
(c) Make the UI call cgi scripts and/or special URL your web framework
would provide
(d) Test and deploy.

IMHO you could get better help/suggestions/answers asking in Ruby on
rails or catalyst or django community’s dev-help channel(s).

If the webserver you deploy with, cant easily handle standard web
frameworks (eg: given above) you would have to tinker with them to
work with the webserver in question, or write your own.


He doesn't need to learn a MVC framework... he could write a simple
CGI with a little Ajax to have something perfectly useful in a couple
of hours.

Seriously, just pick up a book on CGI programming in Perl or whatever
scripting language of choice or ask someone who has taken a web
programming course in college.  This isn't a "hard" problem or
specific in any way to tcpdump, it's a pretty simple web programming
problem.

The only tricky bit is tcpdump needs to run as root and most
webservers don't run CGI's as root for security reasons.  The easiest
thing is just suid root the tcpdump binary to fix that.  Note: that
this has security implications so you may not want to do this on a
multi-user system.  Hence I'd copy tcpdump to a special location and
do:

cp tcpdump tcpdump.root
chmod 750 tcpdump.root
chown root tcpdump.root
chmod u+s tcpdump.root
chgrp tcpdump tcpdump.root

and then anyone in the 'tcpdump' group can run the tcpdump.root binary
without needing to be root.


-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: