From: "Taylor, Grant" <gtaylor@riverviewtech.net>
To: netfilter@lists.netfilter.org
Subject: Re: Prevent traceroutes
Date: Fri, 20 May 2005 02:44:14 -0500 [thread overview]
Message-ID: <428D954E.1010105@riverviewtech.net> (raw)
In-Reply-To: <428D8638.4040301@riverviewtech.net>
> iptables -t filter -A DROP_TRACE -o eth0 -p udp -m recent --name Drop_Traceroute --update --seconds 200 --rdest -j DROP
> iptables -t filter -A DROP_TRACE -o eth0 -p udp -m recent --name Drop_Traceroute --set --rdest -m ttl --ttl-eq 1 -j DROP
> iptables -t filter -A DROP_TRACE -o eth0 -p icmp -m recent --name Drop_Traceroute --update --seconds 200 --rdest -j DROP
> iptables -t filter -A DROP_TRACE -o eth0 -p icmp -m recent --name Drop_Traceroute --set --rdest -m ttl --ttl-eq 1 -j DROP
>
> The only thing that I have not figured out as of yet how to do is DROP
> the first packet that the firewall sees as every attempt that I made,
> even a DROP policy on the FORWARD and OUTPUT chain, did not block the
> first "TTL Time Exceeded" response.
I just figured it out and have tested it. I *think* the reason that my first script did not work for the first router is b/c the raw routing code will send the ICMP TTL time exceeded message before any of the chains in the filter table have a chance to process the packet. Hens my using the nat:PREROUTING chain. I have also made the filtering process easier too as you do not have to filter in the filter:INPUT and filter:FORWARD chains, just the nat:PREROUTING now.
iptables -t nat -A PREROUTING -i $LAN -p udp -m recent --name Drop_Traceroute --update --seconds 200 --rdest -j DROP
iptables -t nat -A PREROUTING -i $LAN -p udp -m recent --name Drop_Traceroute --set --rdest -m ttl --ttl-eq 1 -j DROP
iptables -t nat -A PREROUTING -i $LAN -p icmp -m recent --name Drop_Traceroute --update --seconds 200 --rdest -j DROP
iptables -t nat -A PREROUTING -i $LAN -p icmp -m recent --name Drop_Traceroute --set --rdest -m ttl --ttl-eq 1 -j DROP
This will prevent any traceroutes via the methods mentioned before from any computer coming in on interface $LAN.
Grant. . . .
next prev parent reply other threads:[~2005-05-20 7:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 22:07 Prevent traceroutes Kenneth Kalmer
2005-05-19 23:23 ` Jason Opperisano
2005-05-19 23:33 ` Jason Opperisano
2005-05-20 6:39 ` Taylor, Grant
2005-05-20 7:44 ` Taylor, Grant [this message]
2005-05-20 15:20 ` Jason Opperisano
2005-05-20 15:34 ` Taylor, Grant
2005-05-20 18:44 ` Charlie Brady
2005-05-20 19:03 ` Taylor, Grant
2005-05-20 19:37 ` Jason Opperisano
2005-05-23 7:01 ` Jozsef Kadlecsik
2005-05-20 8:01 ` Kenneth Kalmer
2005-05-20 1:12 ` Sertys
2005-05-20 19:17 ` Sebastian Siewior
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=428D954E.1010105@riverviewtech.net \
--to=gtaylor@riverviewtech.net \
--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