Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Josh Cepek <josh.cepek@usa.net>
To: Gary Renshaw <gary@trilunar.ca>, netfilter@vger.kernel.org
Subject: Re: SNAT spoofing problem
Date: Wed, 07 May 2008 16:12:31 -0500	[thread overview]
Message-ID: <48221B3F.5020507@usa.net> (raw)
In-Reply-To: <4821ED37.3020201@trilunar.ca>

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

Gary Renshaw wrote:
> I am trying to get a host to reject pings with an ICMP 
> host-unreachable message so that it looks like the host doesn't 
> exist.  This is easy and works nicely.

This will not do what you want for several reasons.  On a local network, 
the "host unreachable" condition is identified by the system _sending_ 
the pings when there is no ARP reply from the target host; this means 
that any local host can know the "stealth" host is up from the ARP 
reply.  This method also won't work beyond most gateways unless you have 
the cooperation of the gateway; most gateways are configured with 
firewalls that prevent spoofing across subnets, and thus it will drop 
any packets with invalid source addresses on them.  In your diagram 
anything upstream from the gateway would receive replies from the WAN 
(or upstream) IP address, not the LAN, and the gateway won't (or at 
least shouldn't) accept LAN packets sourced with an IP on a different 
network.

If your goal is to hide the "stealth" host from clients on the local 
network, it's pointless; ARP's give you away as a live host anyway, and 
there's no way to "fix" that without breaking TCP/IP functionality 
all-together.

> The problem is that I'd like to use SNAT to spoof the source address 
> so that the ICMP looks like it is coming from the network's gateway, 
> not the stealthy host.  This isn't working the way I expected.
>
> I've set up a very simple test rig for this.
>
> 192.168.1.1 (GATEWAY) <-----> 192.168.1.2 (STEALTH)
>                          |
>                          \--> 192.168.1.3 (WORKSTATION)

-- 
Josh



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      parent reply	other threads:[~2008-05-07 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 17:56 SNAT spoofing problem Gary Renshaw
2008-05-07 19:02 ` Gáspár Lajos
2008-05-07 19:55   ` Gary Renshaw
2008-05-07 21:12 ` Josh Cepek [this message]

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=48221B3F.5020507@usa.net \
    --to=josh.cepek@usa.net \
    --cc=gary@trilunar.ca \
    --cc=netfilter@vger.kernel.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