Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Strange outbound requests
Date: Sat, 21 Jan 2012 01:23:50
Message-Id: CAN0CFw2EojegcTasmybeZaYzZszx_3ntS8bdQYQXv+ZYTabmRg@mail.gmail.com
In Reply to: Re: [gentoo-user] Strange outbound requests by Michael Orlitzky
1 >>>> If the machine is running linux, then 'watch "lsof -n|grep TCP|grep
2 >>>> 3680"' as root is a sloppy but effective way to find it. There's
3 >>>> probably some way to set up a firewall rule on the host in question
4 >>>> that logs out the user and (possibly) PID of the connection, but I
5 >>>> don't know.
6 >>>
7 >>>
8 >>> "lsof -i" is easier, it only shows network connections :)
9 >>>
10 >>> catching it when it happens (if it is very briefly connected) could be
11 >>> hard with lsof... Maybe setup a tarpit firewall rule on that box so
12 >>> the connection stays open for a long time.
13 >>
14 >>
15 >> The connections are only attempted a few times throughout the day.  Is
16 >> a tarpit firewall rule the only way to do this?  Can anyone tell me
17 >> what package 'watch' belongs to if that would work?
18 >>
19 >
20 > `watch` isn't going to help too much unless you're looking at it. Append the
21 > output to some log file instead. I chose netstat because its output looked
22 > easier to parse with a stupid regexp.
23 >
24 >  while true; do
25 >    netstat -antp | grep ':993 ' >> mystery.log;
26 >    sleep 1;
27 >  done;
28 >
29 > You'll want to change the port -- I tested to make sure that was really
30 > logging my Thunderbird connections.
31
32 Thanks a lot. Test, working, will watch the log and report back.
33
34 - Grant