Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Jörg Harmuth" <harmuth@mnemon.de>
To: netfilter@lists.netfilter.org
Subject: Re: prerouting logging
Date: Wed, 27 Jul 2005 16:59:48 +0200	[thread overview]
Message-ID: <42E7A164.6060305@mnemon.de> (raw)
In-Reply-To: <42E79B51.1080206@eccotours.dyndns.org>

Brent Clark schrieb:
> Hi all
> 
> I got tips for nmap blocking from someone on this list.
> Im trying to log the problems that logged.
> Would anyone care to recheck my rulset, just to make to I got this right.
> 
> # Xmas scan, caught nmap v3.00
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags ALL FIN,URG,PSH -j LOG
> --log-prefix "PREROUTING: " --log-tcp-options --log-ip-options
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
> 
> # Generic Xmas scan, haven't checked if nmap triggers this
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags ALL ALL -j LOG --log-prefix
> "PREROUTING: " --log-tcp-options --log-ip-options
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags ALL ALL -j DROP

As far as I know and can see - no.

> # Misc scan - everyone tests for this, but what scan does it match?
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags SYN,RST SYN,RST -j LOG
> --log-prefix "PREROUTING: " --log-tcp-options --log-ip-options
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
> 
> # FIN scan, nmap v3.0 sends ACK,FIN FIN
> # SYN,FIN SYN,FIN does not match nmap
> # FIN FIN gets false positives when using SSH TARPIT
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags ACK,FIN FIN -m state
> --state NEW -j LOG --log-prefix "PREROUTING: " --log-tcp-options
> --log-ip-options
> $IPT -t nat -A PREROUTING -p tcp --tcp-flags ACK,FIN FIN -m state
> --state NEW -j DROP

I think at least the NULL scan (--tcp-flags ALL NONE) is missing and ACK
scan (--tcp-flags ACK|ALL ACK -m state --state NEW).

But the latter situation may also occur, if your TCP crashes (loosing
all connection information) durind data transfer or the like and then
comes back (however this may happen). Dropping the packet leaves the
sender, who thinks there is a connection, waiting until timeout. So, to
see, if this is a scan, it may be more secure to combine it with the
recent match (personally I think, that this will happen very seldom on a
Linux box, but I may be totally wrong).

Have a nice time,

Joerg



  reply	other threads:[~2005-07-27 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-27 14:33 prerouting logging Brent Clark
2005-07-27 14:59 ` Jörg Harmuth [this message]
2005-07-27 16:58 ` curby .
2005-07-28  6:29 ` Jan Engelhardt

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=42E7A164.6060305@mnemon.de \
    --to=harmuth@mnemon.de \
    --cc=netfilter@lists.netfilter.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