bot47
bot47

Reputation: 1514

Sending arp via shell

Is there a way a send custom (and event undemanded) arp responses via shell (e.g. by hand or by a shell script) on MacOS X or any other UNIX? In addition, is there a way of making the software ask for the MAC representation for all IPs in the current subnet without sending pings the anyone?

Upvotes: 2

Views: 7224

Answers (3)

nazar
nazar

Reputation: 11

There are also arp-scan using libpcap; and arpdropper using libnet.

To passively (or actively) sniff your network for ARP packets and display the IP and MAC address of the machine that generated the packet you may use a Mac OS X application called ArpSpyX.

# arpdropper requires http://sourceforge.net/projects/libnet-dev/ to compile
# (libnet & arpdropper successfully compiled on Mac OS X 10.6.8)
curl -LO http://thebends.googlecode.com/svn/trunk/misc/arpdropper.c
gcc -Wall -Wextra -lnet -o arpdropper arpdropper.c

./arpdropper

# Usage: ./arpdropper -i <device> -s <source ip> -d <dest ip>
# For arp replies:
#   ./arpdropper -r -i <device> -s <source ip> -m <source mac> -d <dest ip>

# using nmap
# get a pre-compiled Mac OS X version of nmap at:
# http://nmap.org/download.html#macosx or
# http://www.berndsworld.com/downloads/
nmap -PR -oN nmap-arpscan.txt 192.168.0.0/16

Upvotes: 1

Jacek Ławrynowicz
Jacek Ławrynowicz

Reputation: 2700

Yes there is. This kind of activity is used in ARP Spoofing and ARP Poisoning attacks and is preformed for ex. by arpspoof. If You want to discover host's MAC, when You know its IP and it is located in Yours broadcast domain (LAN), use arping. ARP is layer 2 protocol, so it's packets are not forwarded by routers but it's much more reliable then ICMP echo (ping).

Some tools:

  • arp - standard program (win/unix) used to list host's IP-MAC address association cache, which contains already learnt IPs

  • arping - unix program which sends ARP Request for a given IP and displays MAC contained in received ARP Response

  • arpspoof - a program from dsniff package generating bogus ARP Responses

Upvotes: 4

Joao da Silva
Joao da Silva

Reputation: 7639

A packet generator might do the trick. The wikipedia page links to some implementations but I don't know if they work on OSX.

Upvotes: 1

Related Questions