Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
arp spoofing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Wed Aug 11, 2010 2:20 am    Post subject: arp spoofing Reply with quote

Oh great. A security researcher pointed out to me that my gentoo-based router is vulnerable to arp spoofing. Then he took off without suggesting preventative measures. Doh!

So I read that some APs have a 'client isolation' mode where wireless clients are disallowed from talking to each other; this prevents the man in the middle attack. However I'm not sure how to implement this on gentoo.

Then there's static arp tables, which are impractical in this case. Setting a static arp entry for the gateway anyway might be a good idea??

Is there a package I can emerge to detect arp spoofing in progress (say two IPs with the same MAC) ??
Back to top
View user's profile Send private message
xibo
Apprentice
Apprentice


Joined: 21 Aug 2007
Posts: 152
Location: moving between kubuntu and ubuntu kde edition

PostPosted: Wed Aug 11, 2010 9:02 am    Post subject: Reply with quote

Same MAC different Internet Addresses is easy to detect ( i.e. just read a regularily accessed host's (ie router's) /proc/net/arp via cron-job or if they're hiding behind nat read the nat-ter's arptables via snmp ), and a poor man-in-the-middle attack. A good one would use the same mac and inet address combination as his victim.
arpwatch ( net-analyzer/arpwatch ) might help a bit, but it's not teeeh tool to rely on. it's detections can be trusted but it won't detect everything, i.e. someone modifying his mac and inet address to a present combination in your network while being outside of it, and then reconnecting will not be caught ( unless he's stupid and makes a "this-is-my-computer-name" broadcast made by windows os and dhcp clients or something like that )

You might be able to have your access point detect the MAC-modification, depending on how good it's security features are. I wouldn't expect it to be possible with any access points i've seen yet though, it's a feature i know from switches for cabled networks.

Static MACs aren't that bad. If you can use static-address autoconfiguration you can generate static arp tables content, in the worst case by sedding you dhcpd.conf. If you use dynamic-address autoconfiguration you should try to either run some script which sets up the corresponding arp entry each time an address is requested ( DHCPv6 servers can do that, but i'm not aware of DHCPv4 though i only ever used the isc's dhcpv4 server ), or use some sniffer that sniffs on your dhcp servers reply.
I use static autoconfiguration and static arp, though my clients are in a 'database' and at each modification a programm regenerates the dhcpd.conf and /etc/ethers and reloads both, together with iptables to validate people are using the addresses i want them to ( i.e. combining iptables --source and --source-mac and dropping all that don't match in the end ).
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Wed Aug 11, 2010 9:43 am    Post subject: Reply with quote

what about running arpwatch on your system?

or changing your DHCP so you only offer out a smaller network range per client i.e. /30 has only 4 ip's per delegation.

Rich.
Back to top
View user's profile Send private message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Wed Aug 11, 2010 1:57 pm    Post subject: Reply with quote

Thanks for all the good info. I'll check out arpwatch.

... using the info from DHCP is a great idea!

Here's a guy who modified openwrt to prevent arp spoofing:

http://docs.google.com/viewer?a=v&q=cache:TA6HWxbRkycJ:citeseerx.ist.psu.edu/viewdoc/download%3Fdoi%3D10.1.1.134.6856%26rep%3Drep1%26type%3Dpdf+preventing+arp+spoofing+%2Bopenwrt&hl=en&gl=ca&pid=bl&srcid=ADGEESgIvJxzC5Zfmu4Vel7Ztzfh_kEkl4FeqNrP8saZgx2CeTs8XtxThEHf9tuUVYoSUg3ASIqoOEetl4goJ4OcsQ_XS6TSEBDbrEFd-LU37zYOcCv0mIeHmmQTCHXEMk4Uvsd-F0lz&sig=AHIEtbQzY3oSU4P8XOZ3uCF4TQBVnlgqDw

From the document:

Quote:
The DHCP ACK message contains
the client’s MAC address and IP address. Every packet that reaches the Access
Point should be scanned for a DHCP ACK message. Whenever a DHCP ACK
message is encountered the IP address to MAC address mapping should be
retrieved and stored in a mapping table created by the Access Point to store IP
address to MAC address mappings. Since all the wireless clients registered with
the Access Point have to get an IP address using the DHCP protocol, the
mapping table will contain the correct mapping of all the wireless clients that
communicate through this Access Point. Now, whenever the Access Point sees
an ARP request or reply, it can use its mapping table to verify whether the
mapping in the ARP request/reply is valid. If the mapping is not valid, the ARP
request/reply packet can be choked. This prevents the ARP request/reply from
poisoning the ARP cache of all the hosts connected to the Access Point as well
as preventing the spoofed ARP packet from reaching the wired network.


^This guy is using Ebtables to parse the Layer 2 header of every packet passing via the bridge.

I have much to learn. But at least now I've got some idea of how to proceed. Thanks.

Edit: I just discovered ArpOn http://arpon.sourceforge.net/ ... but ArpOn is not a gentoo package, I must compile from source.
Back to top
View user's profile Send private message
mack1
Guru
Guru


Joined: 18 Mar 2006
Posts: 315

PostPosted: Wed Aug 11, 2010 4:53 pm    Post subject: Reply with quote

There are also arptables and ebtables (for building a brouter :D ) that could help:

http://en.wikipedia.org/wiki/Arptables

http://ebtables.sourceforge.net/

Cheers
Back to top
View user's profile Send private message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Fri Aug 13, 2010 8:39 pm    Post subject: Reply with quote

For testing, I setup an old laptop as an attacker. I tried to perform the MiTM arp-spoofing attack with ettercap. I could see changes to my 'victim' laptop's arp table, indeed, it believed it's gateway was the attacker's MAC.

I slapped this into my router:
Code:

arptables -F
arptables -X
arptables -P INPUT ACCEPT
arptables -P OUTPUT ACCEPT
arptables -A INPUT -s 192.168.1.1 ! --source-mac 00:12:34:56:78:90 -j DROP

...where 00:12:34:56:78:90 is the MAC of the NIC assigned to 192.168.1.1 (the gateway)

Even with my arptables rules the victim's laptop still thinks the gateway belongs to the attacker after arp spoofing, and thus browsing the internet breaks for the victim. So although I might be able to avoid a MiTM attack this way, it's still DoS.

AP isolation is what I'm after. I flashed dd-wrt to an AP because it has support for AP isolation. When it is enabled the attacking machine can only see the gateway and the attacks are prevented. I think HostAPD has support for this too.

I feel a bit safer now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum