kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: daniel.baluta@gmail.com (Daniel Baluta)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Snooping on sockets/file descriptors
Date: Thu, 31 Mar 2011 22:58:13 +0300	[thread overview]
Message-ID: <AANLkTimVnAY0WAt467MNh=X_BRR-6rgVZ-UgmGb0FbKS@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinOmefDi3qSN6-yrAa+ewD4=n8Qe3xaE4BCJFzQ@mail.gmail.com>

On Thu, Mar 31, 2011 at 10:29 PM, Vimal <j.vimal@gmail.com> wrote:
> Hi,
>
> Is it possible for an application (say "snoop", with sufficient
> privileges) to monitor data on any socket/file descriptor in the
> system?
>
> Here's an example: ?suppose we have a browser and it creates a tcp
> socket to connect to a URL. ?Whenever the browser issues a read() and
> data is pushed to user space, I want "snoop" to get notified and made
> available a copy of the same data that the browser read.
>
> ptrace can be used to do it, but then there are several ways the app
> can read data. ?It could use read(), or recv() or recvmsg(). ?Is there
> a better way to deal with this complexity?
>
> It's like the action of "tee" on any socket/file descriptor in the system.

How about tcpdump?

thanks,
Daniel.

  reply	other threads:[~2011-03-31 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTimuc_tuZ9kVJU6q6CXDzE737vZYvfrKekN+SzcM@mail.gmail.com>
2011-03-31 19:29 ` Snooping on sockets/file descriptors Vimal
2011-03-31 19:58   ` Daniel Baluta [this message]
2011-03-31 20:04     ` Vimal
2011-04-01  0:19       ` Mulyadi Santosa
2011-04-01  7:23         ` Vimal
2011-04-01 13:34           ` Javier Martinez Canillas
2011-04-01 15:28             ` Vimal
2011-04-04 15:43   ` Florin Malita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTimVnAY0WAt467MNh=X_BRR-6rgVZ-UgmGb0FbKS@mail.gmail.com' \
    --to=daniel.baluta@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).