[Dshield] Question about logging from Linux and security newb ie

Matt Gehrls MGehrls at bethanypress.com
Tue Oct 22 18:42:00 GMT 2002


> 
> post a few packets to this list. Cable modems in particular 
> send Multicast packets. While there is no harm in rejecting 
> them, you don't need to log them either.

I'll include the ethereal and log output that I generated in 30 sec with:

sudo /usr/sbin/tethereal -n -i eth0 'ip broadcast or ip multicast or port
137 or port 138 or port 139' > /tmp/ethereal.out & sudo tail -f -n0
/var/log/messages > /tmp/syslog.out & sleep 30 && sudo killall tethereal &&
sudo killall tail
(still learning but I think I got something usable...)


> Multicast and broadcasts can be used for DDOS attacks (e.g. 
> it appears that last evenings DDOS against the root name 
> servers used 'smurf'.). I usually drop any ICMP on my 
> firewall. The question is how much of it you want to log. For 
> my personal firewall:
> 
> - log every droped packet, but use the 'log-prefix' to classify them.
> - use 'swatch' to alert me only on certain categories. I start out
>   with 'everything' and add 'ignore' filters as I get sick of certain
>   alerts.

I had never heard of swatch, checking... thanks.

 
> What are your rules right now? By default, packets are 
> dropped without logging. BTW: Logging is very helpful to 
> debug problems, which is why I log everything.

I would like to log everything but in 4 hours my /var/log/messages file was
43MB.

Here are my rules as they stand at the moment:

# Generated by iptables-save v1.2.5 on Tue Sep 24 09:33:12 2002
*mangle
:PREROUTING ACCEPT [195:32507]
:INPUT ACCEPT [195:32507]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [89:7682]
:POSTROUTING ACCEPT [89:7682]
COMMIT
# Completed on Tue Sep 24 09:33:12 2002
# Generated by iptables-save v1.2.5 on Tue Sep 24 09:33:12 2002
*nat
:PREROUTING ACCEPT [126:24129]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [4:258]
[4:258] -A POSTROUTING -o eth0 -j MASQUERADE
[0:0] -A PREROUTING -i eth0 -s 204.118.172.64/255.255.255.240 -m tcp -p tcp
--dport 4899 -j DNAT --to-destination 192.168.73.100
COMMIT
# Completed on Tue Sep 24 09:33:12 2002
# Generated by iptables-save v1.2.5 on Tue Sep 24 09:33:12 2002
*filter
:INPUT DROP [111:20622]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [89:7682]
[75:10138] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
[0:0] -A INPUT -s 192.168.73.0/255.255.255.0 -i eth1 -j ACCEPT
[0:0] -A INPUT -s 192.168.4.0/255.255.255.0 -i eth1 -j ACCEPT
[0:0] -A INPUT -s 192.168.4.0/255.255.255.0 -i ipsec+ -j ACCEPT
[0:0] -A INPUT -m udp -p udp --dport 500 -j ACCEPT
[0:0] -A INPUT -i lo -j ACCEPT
[0:0] -A INPUT -s 204.118.172.64/255.255.255.240 -p tcp -m tcp --dport 22 -j
ACCEPT
[0:0] -A INPUT -s 204.118.172.65/255.255.255.255 -j ACCEPT
[0:0] -A INPUT -i eth0 -p 50 -j ACCEPT
# [0:0] -A INPUT -i eth0 -m tcp -p tcp --dport 67:68 -j DROP
# [0:0] -A INPUT -i eth0 -m udp -p udp --dport 67:68 -j DROP
# [0:0] -A INPUT -i eth0 -d 255.255.255.255/32 -j DROP
# [0:0] -A INPUT -i eth0 -m udp -p udp --dport 137:139 -j DROP
# [0:0] -A INPUT -i eth0 -m tcp -p tcp --dport 137:139 -j DROP
# [0:0] -A INPUT -i eth0 -d 224.0.0.1 -j DROP
# [0:0] -A INPUT -i eth0 -m udp -p udp --dport 111 -j DROP
# [0:0] -A INPUT -i eth0 -m udp -p udp --dport 21789 -j DROP
[0:0] -A INPUT -i eth0 -j LOG --log-prefix "INPUT-DROP: " --log-level 6
[0:0] -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
[0:0] -A FORWARD -s 192.168.73.0/255.255.255.0 -j ACCEPT
[0:0] -A FORWARD -i eth0 -m tcp -p tcp --dport 4899 -s
204.118.172.64/255.255.255.240 -j ACCEPT
[0:0] -A FORWARD -i ipsec+ -s 192.168.4.0/24 -o eth1 -j ACCEPT
[0:0] -A FORWARD -j LOG --log-prefix "FORWARD-DROP: "  --log-level 6
COMMIT
# Completed on Tue Sep 24 09:33:12 2002


Thanks
Matt Gehrls

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.dshield.org/pipermail/list/attachments/20021022/80ad6157/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syslog.out
Type: application/octet-stream
Size: 90261 bytes
Desc: not available
Url : http://www.dshield.org/pipermail/list/attachments/20021022/80ad6157/syslog.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ethereal.out
Type: application/octet-stream
Size: 56361 bytes
Desc: not available
Url : http://www.dshield.org/pipermail/list/attachments/20021022/80ad6157/ethereal.obj


More information about the list mailing list