linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: akuda <akuda@poczta.fm>
Cc: linux-admin@vger.kernel.org
Subject: Re: How to inentify local source of connection (program and user)
Date: Sun, 30 Nov 2008 18:48:25 +0000	[thread overview]
Message-ID: <18738.57337.57071.379361@cerise.gclements.plus.com> (raw)
In-Reply-To: <20757992.post@talk.nabble.com>


akuda wrote:

> Recently I found some unidentified outgoing connections (UOC, instead of
> UFO) from one of my linux machines (gentoo, firewall by vuurmuur.org via
> ipTables). Those UOC occurs soon after boot time, even though I closed all
> services. These are DNS calls.
>    So I asked my friends full-time admins, how to check which program
> requests access to internet, and what user started this program. If, for
> example, RIAA would come to some University telling that from their IP
> someone is downloading "Lilo & Stitch" illegally, the admin should be able
> to tell who turned on bittorrent :) . And what stroke me was the fact, that
> they actually didn't know! They asked me to hunt for those UOC, and then
> type netstat with some options, to get the path to the binary, and locate in
> someone's home directory (the bittorrent client won't be probably installed
> as general bin for all users :) ).
>    Any other idea how to do it? Can I force linux to log who and how is
> requesting a outgoing connection?

You can tell iptables to log the UID with the --log-uid option, but if
it's UID 0 (root), that doesn't tell you much.

You could configure iptables to block "unknown" outbound DNS queries,
and hope that whatever is sending them generates an error message when
the lookup fails.

You can use tcpdump to log outbound DNS queries, eliminate "known"
queries, and examine the remainder to see if the content of the
queries provides some clues as to the origin.

As a last resort, you could modify the source for libnss_dns or
libresolv to log the current PID.

-- 
Glynn Clements <glynn@gclements.plus.com>

      parent reply	other threads:[~2008-11-30 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-30 14:06 How to inentify local source of connection (program and user) akuda
2008-11-30 14:38 ` Herta Van den Eynde
2008-11-30 17:02 ` Michael H. Warfield
2008-11-30 18:48 ` Glynn Clements [this message]

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=18738.57337.57071.379361@cerise.gclements.plus.com \
    --to=glynn@gclements.plus.com \
    --cc=akuda@poczta.fm \
    --cc=linux-admin@vger.kernel.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).