Home page logo

nanog logo nanog mailing list archives

Re: BCP38 tester?
From: Matt Palmer <mpalmer () hezmatt org>
Date: Tue, 2 Apr 2013 07:33:45 +1100

On Mon, Apr 01, 2013 at 12:31:05PM -0400, Jay Ashworth wrote:
From: "Jimmy Hess" <mysidia () gmail com>

Ah, but did you actually test your guess on a reasonably large variety
of NAT platforms?

He may not have, but now that I'm thinking (caffeine is a wonder drug),
I have: I've worked on, for customers, nearly every brand of consumer
router on the market, and all of them do outbound NAT the same way:

Pick up a DHCP address from the carrier, and use that as the source IP
on all translated outbound packets.

The key issue at hand (I believe; please correct me if I'm wrong) is that
"all translated outbound packets" may not equal "all outbound packets". 
Depending on how a NAT device is configured, it may pass some packets
*untranslated*, and that allows a malicious actor behind the NAT device to
still get their spoofed traffic out.

To relate it back to something concrete, imagine this iptables rule in an
otherwise "fully open" configuration:

    iptables -t nat -A POSTROUTING -s -o wan -j MASQUERADE

Now, spoof a packet from behind this NAT box as coming from
what happens?  It gets passed through the NAT box, *without* being NATed. 

Of course, it isn't hard to stop this sort of thing...

    iptables -A INPUT ! -s -i lan -j DROP

(or any number of other equivalent rules)  The question is, how many
in-common-use CPEs have considered this attack vector and are actually doing
something functionally equivalent to the DROP rule above?

I don't know, because I haven't tried it, but I'd only be surprised if the
answer was "none" or "all of them".

- Matt

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]