From owner-freebsd-questions@FreeBSD.ORG Tue Sep 12 20:09:06 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85B4316A47B for ; Tue, 12 Sep 2006 20:09:06 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC3A843D83 for ; Tue, 12 Sep 2006 20:08:31 +0000 (GMT) (envelope-from wmoran@collaborativefusion.com) Received: from collaborativefusion.com (mx01.pub.collaborativefusion.com [206.210.89.201]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Tue, 12 Sep 2006 16:08:31 -0400 id 0005641C.450713BF.0000CA17 Received: from Internal Mail-Server (206.210.89.202) by mx01 (envelope-from wmoran@collaborativefusion.com) with AES256-SHA encrypted SMTP; 12 Sep 2006 16:05:42 -0400 Date: Tue, 12 Sep 2006 16:08:30 -0400 From: Bill Moran To: Bart Silverstrim Message-Id: <20060912160830.b7a91061.wmoran@collaborativefusion.com> In-Reply-To: <7269D41C-C334-44DC-9549-ACB28F79014A@chrononomicon.com> References: <7269D41C-C334-44DC-9549-ACB28F79014A@chrononomicon.com> Organization: Collaborative Fusion X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.20; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: forwarding as a gateway, logging certain traffic X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 20:09:06 -0000 In response to Bart Silverstrim : > This will probably be kind of wordy, but I could use some advice on > how to track it. > > I have a freebsd system acting as a gateway (it's using IP > forwarding) so it can act as a web proxy server and filter for the > users. It is also filtering incoming email to act as a mail filter > between the Internet and our internal Exchange server. > > The firewall rules used for forwarding information to Squid are > rather simple. Ipfw -list gives: > ******* > 00049 allow tcp from 10.46.255.253 to any > 00050 fwd 10.46.255.253,3128 tcp from any to any 80 > 00100 allow ip from any to any via lo0 > 00200 deny ip from any to 127.0.0.0/8 > 00300 deny ip from 127.0.0.0/8 to any > 65000 allow ip from any to any > 65535 deny ip from any to any > ******** > > The DHCP server then hands out the IP of the FreeBSD server as the > gateway address. > > Something inside our network is infected with a spam-mailing trojan. > We now have our PIX firewall set to block all outgoing traffic to > port 25 unless it is from our mail server. After setting up a syslog > monitor and checking the logs to see if the culprit would appear, > what should appear but...the FreeBSD server. > > Then I smack my forehead; of course it would show up. It's supposed > to be the gateway. The trojan computer hits the BSD system and from > there hits the PIX...the PIX will be useless to find the culprit. > > Is there some way to get the FreeBSD system to log machines using > port 25 without interfering with the FreeBSD machine's filtering of > email function? Or at least make the traffic visible to sniffing > with tcpdump or wireshark or ethereal? Off the top of my head ... ipfw add 25 log tcp from any to any 25 should work. There are certain kernel configs you have to have in place for logging to work, though. -- Bill Moran Collaborative Fusion Inc. **************************************************************** IMPORTANT: This message contains confidential information and is intended only for the individual named. If the reader of this message is not an intended recipient (or the individual responsible for the delivery of this message to an intended recipient), please be advised that any re-use, dissemination, distribution or copying of this message is prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. ****************************************************************