PDA

View Full Version : Layer 2 Attacks


GMouse
05-29-2007, 05:36 PM
I have been experimenting with the dsniff suite on my own home network, and it's frighteningly easy to use.

arpspoof -t victim gateway
arpspoof -t gateway victim

works flawlessly, along with setting ip forwarding. As I understand it, the first command makes the victim think that I'm the gateway, effectively routing all outbound traffic through my system. The second does the reverse, giving me all inbound traffic. urlsnarf confirmed the success of the attack. That's good.

I tried running arpspoof gateway which should make all devices on the network think that I'm the gateway, thereby redirecting all outbound traffic through my system, but not inbound. Unfortunately, this didn't work, and I got nothing, even a while after starting arpspoof. Why is this?

Also, I tried running arpspoof from my laptop, which was connected to my network wirelessly, and arpspoof would always fail, citing something along the lines of an "unknown network" and flashed the code "0x321". Am I to understand that arpspoof will not work from a wireless host? (The target system and the gateway are both wired, and successfully misdirected from my desktop, as described above.)

Finally, macof looks interesting, and I think I may give it a try on my switch, but I don't fully understand the process. The switch gets overloaded with MAC addresses and copes the only way that it knows how, by becoming a hub. Now, how does the switch recover from this? Does just start collecting MACs again sometime after the storm has died down, or does it stay open? I don't want to damage any of my hardware, after all.

Thank you!

theprez98
05-29-2007, 05:41 PM
You might try running fragrouter before arpspoof:
Kernel IP forwarding (or a userland program which accomplishes the same, e.g. fragrouter(8)) must be turned on ahead of time.

GMouse
05-29-2007, 05:45 PM
In both cases, I turned on ip forwarding before doing any spoofing.

echo 1 > /proc/sys/net/ipv4/ip_forwarding
(There may be a typo, as I don't have access to a Linux box at the moment. :( )

theprez98
05-29-2007, 05:58 PM
In both cases, I turned on ip forwarding before doing any spoofing.

echo 1 > /proc/sys/net/ipv4/ip_forwarding
(There may be a typo, as I don't have access to a Linux box at the moment. :( )

Having not used arpspoof before, not sure where to go from there...

blackfoot
07-27-2007, 06:50 PM
arpspoof is not configured to handle the SNAP headers used in wireless technologies. You will need to write a new script handler to accomplish a similar redirect on 802.11 packets. It is possible in python for example.

MAC addresses decay after a time and so the switch will recover slowly.

Your repetition of the arpspoof commands is correct and should work on hardwired systems or hardwired into the back of the wireless hub.

A wireless AP acts as a hub not as a switch.

IP forwarding should always be enabled prior to redirecting to maintain functionality of the network.