iptables spof address problem
Quoted 65 lines
-----Original Message-----
From: Piotr Holubniak [mailto:[email protected]]
Sent: Thursday, September 29, 2005 2:15 PM
To: Derick Anderson
Cc: [email protected]
Subject: Re: iptables spof address problemDerick Anderson napisa³(a):
Quoted 14 lines
Quoted 4 lines
Quoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Piotr Holubniak
Sent: Thursday, September 29, 2005 1:22 AM
To: [email protected]
Subject: Re: iptables spof address problemQuoted 6 lines
[snip]
Quoted 2 lines
This is not a question of routing Layer 2. All computers are in one local network in the same subnet, so there is no need to
route pakets.
Quoted 3 lines
Quoted 3 lines
This seems to me that even if data arrives to NIC of Linux computer with netfilter, from computer with MAC address, this MAC address is unseen to netfilter, because before it is passed to
netfilter, TCP/IP
Quoted 4 lines
Quoted 4 lines
stack tries to resolve MAC sending ARP lookup. Sa finally netfilter gets wrong MAC.
Not sender but ARP lookup.Quoted 10 lines
Quoted 7 lines
Tell me if I am wrong.
Regards
PiotrH
Netfilter is designed to improve security of network or computer system.
I well designed network, such mechanism like "security port" in switch, doesn't allow you to spoof MAC address. Simply because it limits number of MAC addresses which can leave port to only one, and this one is registered and cannot be changed without supervisors pertmition.
In described by me scenario, attacker doesn't need to spoof MAC address to be unvisible, it is enaught to spoof IP. So funcjonality of "security port" is very limited. I belive that netfilter should allways display real MAC address. I don't know how to changet it.
Quoted 4 lines
Regards
PiotrH
From the hping man page:
-a --spoof hostname
Use this option in order to set a fake IP source address, this option ensures that target will not gain your real address. However replies will be sent to spoofed address, so you will can't see them. In order to see how it's possible to perform spoofed/idle scanning see the HPING2-HOWTO.
I reiterate: a properly spoofed packet is completely identical to a genuine one. It is not Netfilter's or the kernel stack's fault, it is a simple fact of life that bits are bits. With an intelligent switch this kind of attack can be stopped provided the switch is set to use a 1-to-1 ratio of ports to MACs and to drop invalid packets. However, it is not possible prevent this attack when nothing separates the two boxes but twisted pair.
Derick Anderson
Quoted 1 line · Derick Anderson
I reiterate: a properly spoofed packet is completely identical to a genuine one. It is not Netfilter's or the kernel stack's fault, it is a simple fact of life that bits are bits. With an intelligent switch this kind of attack can be stopped provided the switch is set to use a 1-to-1 ratio of ports to MACs and to drop invalid packets. However, it is not possible prevent this attack when nothing separates the two boxes but twisted pair.
Well, if all you have between the boxes is a twisted pair, then identifying who sent the spoofed packet is trivial (you know where the other end of that cable is, don't you?). And also making anti-spoof rules is equially trivial. You know both MAC and IPs that box should use so making a filter ruleset to drop everything else is trivial. In this case you should not even need to care about MAC spoofing and as the MAC addrssing is only relevant between the two boxes.. (unless ofcourse if you act as a bridge to some other interface)
Problems to trace spoofing in an Ethernet arise if there is a HUB or switch without MAC locking features. In HUB based networks it is really bad as all you can tell is that the packet came from some station in the network connected to that HUB. In the switched network you may be able to find the originating port by querying the switch for its MAC forwarding table (each time a switch sees a new source MAC address on a port it is registered in the MAC forwarding table).
Regards
Henrik