Linux Netfilter discussions
 help / color / mirror / Atom feed
* Security question
@ 2004-03-01 12:55 Sasa Stupar
  2004-03-01 13:03 ` Ray Leach
  2004-03-01 13:10 ` Antony Stone
  0 siblings, 2 replies; 10+ messages in thread
From: Sasa Stupar @ 2004-03-01 12:55 UTC (permalink / raw)
  To: Netfilter-List

What is the potential security problem if you have network as follows:

SOLUTION 1

INET-CABLE MODEM-----------------|
ROUTER-eth0-public IP address----|
ROUTER-eth1-private IP address---|------->SWITCH
ROUTER-eth2-private IP address---|
Internal server for mail,web-----|
all LAN users with private IP----|


SOLUTION 2

INET-CABLE MODEM-->eth0-ROUTER|--eth1|
			       --eth2|-->SWITCH
		 server and LAN users|

I am thinking of the solution 1 because cable modem is a little bit to 
far away from the router and I don't want to use to much of the cables. 
I have setup router with MAC address filtering and also put firewall on 
all internal computers.

What is possible security problem comparing the 2 solutions above?

Regards,
Sasa


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re:Security question
@ 2004-03-01 13:41 Sasa Stupar
  2004-03-01 14:25 ` Security question Sasa Stupar
  0 siblings, 1 reply; 10+ messages in thread
From: Sasa Stupar @ 2004-03-01 13:41 UTC (permalink / raw)
  To: Netfilter-List

Thanx guys. Yes, I have a linux router. I have tested the solution one 
and looked at the console; there were a lot of "martians" on the nic's 
not intended for the source.
What about the external threat on the solution 1?
Internal users are unable to change anything since they don't have admin 
rights.

Sasa


^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: Security question
@ 2004-03-01 22:24 bmcdowell
  2004-03-01 22:47 ` John A. Sullivan III
  0 siblings, 1 reply; 10+ messages in thread
From: bmcdowell @ 2004-03-01 22:24 UTC (permalink / raw)
  To: netfilter


Anthony is correct.  Google it and you'll find numerous examples:

http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&q=forg
e+MAC+address+nic

Despite this fact, however, you don't seem to be using your imagination.
I've always preferred it when security people were just a little more
paranoid:

Imagine a scenario where some form of unknown attack is used to kill
your 'router' and turn one of your connected PC's into a 'router'
instead.

In that case, you would probably wish you had used scenario #2...  With
#2 a dead router means no internet, and that might actually be a good
thing - in an ostrich sort of way.


Bob

-----Original Message-----
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org]On Behalf Of Sasa Stupar
Sent: Monday, March 01, 2004 8:25 AM
To: Netfilter-List
Subject: Re: Security question


But with the MAC/IP filtering I can restrict access to the router. So 
anyone who is not in the MAC table for accept it will be refused.
I don't think that it is possible to forge MAC address of nic, or am I 
wrong?

Sasa


^ permalink raw reply	[flat|nested] 10+ messages in thread
* security question
@ 2004-06-02 12:58 Andreas Westendörpf
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Westendörpf @ 2004-06-02 12:58 UTC (permalink / raw)
  To: netfilter

Hi *!

I have the following setup. Please tell me if I have some security
issues here.

A linux box with two ethernet interfaces to work as a masquerading
router. One of them (eth0) is connected to a dsl-modem, the other is a
wlan card (eth1). All client systems get this box a default gateway
via dhcp.

My goal is to drop everything coming from the wlan by default. I do
this with:

# iptables -t nat -P PREROUTING  DROP

I want the all www-requests of the client systems to be redirected to
the local Apache on the box. I do this with:

# iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth1 - REDIRECT

As I need DNS for these www-requests I have to let DNS be accepted:

# iptables -t nat -A PREROUTING -p udp --dport 53 -i eth1 -j ACCEPT

Then, in the POSTROUTING chain I need all the packets that made it
here to be masqueraded:

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

If I want to allow a specific wlan client to get outside connections I
use:

# iptables -t nat -I PREROUTING -m mac --mac-source XX:XX:XX:XX:XX:XX
-i the1 -j ACCEPT

to let him through.

Beside of MAC-spoofing, is this setup safe? Can someone get though the
PREROUTING chain, without being "MAC-inserted".

What can I do to block incoming connection attempts? I only want to
allow ssh from outside (internet) to the box.

Any help would be appreciated!

THX,
Andreas Westendörpf




^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: security question
@ 2004-06-03 15:06 Martín Chikilian
  2004-06-03 15:12 ` Antony Stone
  0 siblings, 1 reply; 10+ messages in thread
From: Martín Chikilian @ 2004-06-03 15:06 UTC (permalink / raw)
  To: netfilter

a.westendoerpf@gmx.de wrote:

> Hi *!

> I have the following setup. Please tell me if I have some security
> issues here.

> A linux box with two ethernet interfaces to work as a masquerading
> router. One of them (eth0) is connected to a dsl-modem, the other is a
> wlan card (eth1). All client systems get this box a default gateway
> via dhcp.

> My goal is to drop everything coming from the wlan by default. I do
> this with:

> # iptables -t nat -P PREROUTING  DROP

I don't know if i understand well what you wrote, but i think that your rule applies to drop packets being PREROUTED by default. What is the goal of this??
What you mean with "is to drop everything coming from the wlan by default" ??
You want to drop packets destined TO wlan by default???

> I want the all www-requests of the client systems to be redirected to
> the local Apache on the box. I do this with:

> # iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth1 - REDIRECT

The corect rule for this is the next one:
iptables -t nat -A POSTROUTING -p tcp --dport 80 -i eth1 -j REDIRECT

Note the POSTROUTING chain must be used (I think)

> As I need DNS for these www-requests I have to let DNS be accepted:

> # iptables -t nat -A PREROUTING -p udp --dport 53 -i eth1 -j ACCEPT

> Then, in the POSTROUTING chain I need all the packets that made it
> here to be masqueraded:

> # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

> If I want to allow a specific wlan client to get outside connections I
> use:

> # iptables -t nat -I PREROUTING -m mac --mac-source XX:XX:XX:XX:XX:XX
> -i the1 -j ACCEPT

> to let him through.

> Beside of MAC-spoofing, is this setup safe? Can someone get though the
> PREROUTING chain, without being "MAC-inserted".

Sure there are ways to bypass this restriction, but it is pretty difficult, imho ;-)

> What can I do to block incoming connection attempts? I only want to
> allow ssh from outside (internet) to the box.
Through wlan?? You can do:
iptables --policy INPUT DROP	/* DROP by default incoming packets
iptables --append INPUT --in-interface eth1 --destination-port ssh --jump ACCEPT

Note that if you drop incoming packets by default, you also need to add a few rules:
iptables --append INPUT --in-interface eth1 --match multiport --ports http,https,ftp,ftp-data,ssh,... --jump ACCEPT
You must add the ports that you and your clients commonly use.

Any other doubt, contact the list.

Ciao, Martin



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-06-03 15:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-01 12:55 Security question Sasa Stupar
2004-03-01 13:03 ` Ray Leach
2004-03-01 13:10 ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2004-03-01 13:41 question Sasa Stupar
2004-03-01 14:25 ` Security question Sasa Stupar
2004-03-01 15:08   ` Antony Stone
2004-03-01 22:24 bmcdowell
2004-03-01 22:47 ` John A. Sullivan III
2004-06-02 12:58 security question Andreas Westendörpf
2004-06-03 15:06 Martín Chikilian
2004-06-03 15:12 ` Antony Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox