Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

TCP or SOCKET or HTTP ... track everything my computer is doing

by Anonymous Monk
on Dec 21, 2012 at 00:17 UTC ( #1009823=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to track all connections my pc is making, be it TCP, SOCKET or HTTP?

To put it simply, if my box/pc is talking to the outside world through a network connection, i want to create a log of it.

I would like to capture info similar to what is captured when using something like the Live Http Headers add-on for Firefox.

I'm trying to automate a process, and plan on doing it generically enough that posting the code might be useful for someone else in the future.

Any help would be appreciated, be it vocab, a pointer to where to listen, anything.

Thanks for your help.

  • Comment on TCP or SOCKET or HTTP ... track everything my computer is doing

Replies are listed 'Best First'.
Re: TCP or SOCKET or HTTP ... track everything my computer is doing
by NetWallah (Abbot) on Dec 21, 2012 at 00:38 UTC
    What OS are you working on ? Linux has a built-in "tcpdump" program that can (selectively) capture what you want. There are options in Windows, both Open source (windump) and MS-specific (I believe the MS network monitor is now a part of SMS).

    If you want to capture this info in perl, use the Net::Pcap series of modules.

                 "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius

      Thanks for the quick reply! This is exactly what I needed to get started.

      Ideally, the resulting script will be cross-platform, which is why I want to use Perl.

      I'll post back after I've had a chance to do some appropriate research/experimenting.

      Thanks again!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1009823]
Approved by NetWallah
[Discipulus]: have you been fired?!?
[LanX]: remote rules, I've been offered jobs in the US with the promise to stay outside
[MidLifeXis]: Nope. Just looking around, as there are multiple culture and business changes in the area I am in.
[MidLifeXis]: not yet, anyway. Who knows. Just do my best and whatever happens happens.
[LanX]: should be even easier for you
[Discipulus]: oh well we cant afford two monks fired in a day!
[LanX]: any news from tye ' s search?
[MidLifeXis]: Ugh - who else?
[Discipulus]: so the right term is 'gired'
[Discipulus]: look at ot by karl

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (16)
As of 2017-03-23 12:43 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (286 votes). Check out past polls.