March 31, 2007

Common Misconceptions About ARP Cache Poisoning

In this article I comment on a few misconceptions about ARP cache poisoning that I come across from time to time, even from people who know what ARP cache poisoning is and (more or less) how it works.

If you don't know what ARP cache poisoning is, this article won't help you. A good place to start may be this article by Steve Gibson or this other article by Yuri Volobuev , more advanced and which includes the source code for send_arp (send_arp.c), a tool I'll be naming below.

*** DISCLAIMER ***
If you perform an attack based on the information contained in this article it will be your sole responsibility. Make sure you have appropriate authorization before doing anything that might get you into trouble and please understand that manipulating network traffic is something that can get you into trouble. You've been warned.
*** END OF DISCLAIMER ***

So, on to the misconceptions:


  1. You need very advanced and complicated tools to perform ARP cache poisoning

  2. ARP cache poisoning only works against hosts of specific operating systems (OS)

  3. You can use ARP cache poisoning against hosts on the same LAN only, therefore you can only sniff on connections where the two endpoints of the communication are sitting in the same LAN as you.

  4. An ARP cache poisoning attack would immediately be detected because it would disrupt all or at least some communications in the LAN

  5. Some switches hung when you send one of those fake ARP replies through


1.- You need very advanced and complicated tools to perform ARP cache poisoning

It depends on what you mean by advanced and complicated. All you need is a simple tool capable of sending ARP replies that let you choose the source and destination IP addresses and MAC addresses. My favorite is "send_arp", the source code of which you can find in this article by Yuri Volobuev . You invoke send_arp like this:

send_arp IP1 MAC1 IP2 MAC2

That command will send a single ARP reply stating "IP1 is at MAC1" targeted at system with IP address IP2 and MAC address MAC2.

The rest will depend on what you want to do. If you want the traffic to flow through your box you will need to enable IP forwarding in it. In Linux this can be done with the following command:

echo "1" > /proc/sys/net/ipv4/ip_forward

If you want to sniff the redirected traffic you will obviously need a sniffer (e.g. WireShark or tcpdump), and so on for the different things you want to do, but strictly speaking, for the "ARP cache poisoning" part, you really don't need anything other than send_arp.

2.- ARP cache poisoning only works against hosts of specific operating systems (OS).

Maybe, but I still have to find one OS which it doesn't work against :-). Per the ARP protocol specification itself a host must accept ARP replies at some point or another. The only exception is hosts where ARP is deactivated and static MAC-to-IP translations are used. Those hosts are protected against ARP cache poisoning, but of course they are a pain in the neck to manage, so not many people use it in the real world.

A palliative solution implemented on some OS (I believe this is the case at least in Solaris) is ignoring gratuitious ARP replies, meaning that the host will only accept ARP replies for queries it previously sent. That certainly makes the life of the attacker harder, but just a little bit. It's a race condition: when the system sends an ARP request it will accept the first reply to come back. If the reply from the attacker comes faster than that from the real host it will be accepted. Of course the attacker may improve his/her chances by continuously sending replies till one gets lucky. Once the "poisoned" translation is in the ARP cache it will stay there, undisturbed :-), until it times out and a new ARP query is sent (default is 10 min in Solaris, IIRC).

3.- You can use ARP cache poisoning against hosts on the same LAN only, therefore you can only sniff on connections where the two endpoints of the communication are sitting in the same LAN as you.

Well, yes and no. It's true that ARP cache poisoning is a LAN only thing, so only hosts on the same LAN of the attacker can be poisoned, but routers are also "hosts" in this context: they too can be ARP-cache-poisoned. In general, any traffic exchanged between two MAC addresses in the LAN can be redirected through the attacker's system. The case of two local hosts talking to each other is the most obvious, but an attacker can also sniff traffic going from HOST1 to some system outside the LAN by convincing HOST1 that the MAC address of its default router is that of the attacker's system and convincing the default router that the MAC address of HOST1 is that of the attacker's.

4.- An ARP cache poisoning attack would immediately be detected because it would disrupt all or at least some communications in the LAN.

Not true. If the attacker disrupts any communication it will be their own fault (or intent), not the technique's per se.

Quite often the problem is that people performing the attack forget to turn on IP forwarding on their system and then all traffic that should go _through_ their system ends up being _absorbed_ by it and yes, all communication between the poisoned systems becomes impossible and people won't appreciate it (been there, done that :-/). Worse, if you choose to poison every system on the LAN and you make a mistake like this forgetting to enable IP forwarding you will get nothing less than total chaos (again, not proud of it, but been there, done that :-/ ).

A final word of caution about automated tools, if you let me. If you're going to use them, make sure you know them well. Some automated tools may poison all systems in the LAN by default and then forget to turn on IP forwarding, or do the forwarding themselves just fine at the beginning but then die miserably half way through... and it's not pretty. I've been burnt before and thus I prefer to use good old send_arp to send just the few ARP packets I need and good old Linux kernel for IP forwarding. Call me chicken...

5.- Some switches hung when you send one of those fake ARP replies through.

Well, I can't say I've tried every switch out there so maybe there's some switch that will die if you try to do ARP cache poisoning through it. Yet, chances are that if that happens the reason be that the ARP reply being sent wasn't the right one.

Here is the thing. As long as all the fake ARP replies the attacker sends always say "whatever_IP is at my_real_MAC" (my_real_MAC being the real MAC address of the attacker's system) the switch should never complain. As far as he is concerned those replies match what he knows about the attacker's system: its MAC address (my_real_MAC) is connected to the port it is really connected to. Note that the switch doesn't care about IP addresses so the IP addresses in the ARP reply are simply ignored by it.

However, the attacker may get into trouble if he/she tries to revert the wrongdoing after being finished with the attack by sending a gratuitious ARP reply to the target system containing this time the real IP-to-MAC translation instead of the poisoned one. That will confuse the switch because this packet will mean to it that the MAC address of the spoofed system is connected to your port, but that MAC was already connected to some other port!. That will leave the switch with a duplicate entry on its MAC-to-port translation table (one MAC in two different ports). Different switches will react differently to this anomaly, but none will be "happy" with it, if you know what I mean ;-).

David.

Labels:

March 28, 2007

VoIP Security Tools

I'm a strong defender of how important is to know the vulnerabilities, hacking techniques and tools available for any technology in order to provide effective and efficient countermeasures and security solutions (remember: protect, detect and react).

VOIPSA's VoIP Security Tool List, of which I've been an occasional contributor/reviewer, has been finally published this month. The Black Bag Security Briefing (90-minute recording), available from the BlueBox Podcast, details some of the current VoIP threats, tools and best practices. Additionally, Backtrack v2 Final contains a few of these VoIP security tools, ready to go.

This
is one of the best VoIP security resources available today, together with VOIPSA's VoIP Security Threat Taxonomy and US NIST's Security Considerations for Voice Over IP Systems. There are also a couple of mailing lists, VOIPSA's VOIPSEC and Voptalk, the VOIPSA blog, and my two favorite VoIP security books:

If you are interested in VoIP security, and willing to contribute to the community, you still have time to join the VoIP Security Best Practices project (best practices will be linked to the tools mentioned before).

Labels:

March 02, 2007

WebDAV on Windows: SSL and File Locking

Some time ago I described how WebDAV could be used to securely share files among Windows systems across the Internet. Here I will add a couple of notes about the use of SSL to protect the WebDAV traffic and about the file locking mechanism that WebDAV provides, because there are a few limitations you need to know about if you don't want to spend endless hours trying to make work things that simply can't.

On the server side there is no problem at all; IIS can be configured to require SSL connections with any authentication method desired, from basic up to certificate-based authentication, and all WebDAV methods required for file locking are supportedby IIS. On the client side, however, the following facts need to be taken into account.

First, the WebDAV client included in the Windows operating system has the following limitations:
  • It does not support SSL.
  • It does not support basic authentication by default (from XP SP2 on). You can set a registry key to enable support for basic authentication, but note that it would be a bad move: with no support for SSL the user name and password would end up being sent in the clear across the network.
  • It does not support file locking.
Second, Microsoft Office comes with its own WebDAV client that includes support for file locking (out of the box) and SSL (if you install the appropriate patch: KB892211). Note that both file locking and SSL support will only apply to the applications of MS Office (Word, Excel, etc.). For example, if you try to edit a remote file using notepad.exe over an SSL WebDAV connection you have already established using MS Office you will be able to open the file and edit a local copy but you will not be able to save the changes back to the remote share.

All this means that if you want to use WebDAV over SSL and/or with file locking support with applications other than Microsoft Office you will need a third party WebDAV client. There are several products out there, some free and some commercial. Only make sure the product you choose supports the features you want (SSL, file locking, etc.) because not all products support all features.

David.

Labels: