
Описание
Чтобы отобразить список таблиц кэша ARP для всех интерфейсов, необходимо ввести:
arp /a /n 10.0.0.99
arp /s 10.0.0.80 00-AA-00-4F-2A-9C
Справочная информация

Arp-scan
Creates several arp-scan commands to help locate an unused IP address on a LAN or locate a device patched on a port that is configured on the wrong vlan.
Based on the blog:
Use Arp-scan to find hidden devices in your network by Blackmoreops.com
Installation
This script uses the Python 3 netifaces library to build the list of interfaces.
- git clone https://github.com/rikosintie/arp-scan.git
- sudo apt install python3-dev
- sudo apt install python3-pip
- pip3 install netifaces
- cd arp-scan
- python3 arp-scan.py
Finding an open IP address
The commands are executed from the script and the results returned to the screen. Arp is a layer 2 protocol so the subnet you enter must be on the same vlan as the port you are connected to if you are looking for an open IP Address. The advantage to using ARP over ICMP is that devices with firewalls may not reply to ICMP but they should reply to arp.
Locating a device that is patched on into a port configured on the wrong vlan
Menu item 2 is different. It is designed to arp devices that got patched back in wrong during a cutover and now don’t respond to ping. To use this script, you must be connected to a port that allows tagged traffic on the vlan the device is configured for. Since this is a layer two protocol you don’t need a valid IP address on your laptop.
See
Using arp-scan to find a free ip address
Locate ip devices on the wrong vlan
to read detailed instructions.
On *nix systems use python3 arpscan.py to execute
This should work on Windows 10 running Windows Subsystem for Linux. If you try it and have any problems please open an issue by clicking the “Issues” link above.
You may have to install arp-scan on your system using your package manager. For Ubuntu “sudo arp install arp-scan”.
If your distro doesn’t have arp-scan you can download it from Roy Hill’s Github
If you create a file named “ip.txt” in the folder where you run the script it will load the
IP address as a default and use it where an ip address is needed. The file should have one
line – the ip address or netork and mask (Ex. 192.168.10.0/24) to use.
Double check that the IP you chose really isn’t in use
Script usage
Initial arpscan output
Enter two unused IP addresses
Scan to find a lost device
Input a number to select
Enter the 1st IP Address .
Enter the 2nd IP Address .
Enter an interface name when needed wlp0s20f3
sudo arpscan I wlp0s20f3 arpspa. .
sudo arpscan I wlp0s20f3 arpspa. .
To find a missing device
Script usage
Initial arpscan output
Enter two unused IP addresses
Scan to find a lost device
Input a number to select
Enter the vlan ID:
Enter the MAC Address: ::a9:::f1
Enter the IP Subnet: .
Interfaces found
: lo
: enp60s0
: wlp0s20f3
: gpd0
: docker0
: vethc982936
: vmnet1
: vmnet8
enter interface
interface selected is: enp60s0
IP Subnet .
To rerun copypaste this line:
sudo arpscan I enp60s0 Q destaddr:::9a:b5: .
sudo arpscan I enp60s0 Q destaddr:::9a:b5: .
WARNING: Could not obtain IP address interface wlp0s20f3. Using .
the source address which is probably not what you want.
Either configure enp60s0 with an IP address or manually specify the address
with the arpspa option.
Interface: enp60s0 datalink type: EN10MB (Ethernet)
Starting arpscan with hosts (http:toolsarpscan)
. :::9a:b5: Critical IO LLC (1Q VLAN)
packets received by filter packets dropped by kernel
Ending arpscan : hosts scanned seconds ( hostssec) responded
You can see that arp-scan found the device by mac address and the device replied with its IP address and that the laptop didn’t have an address.

Задачка – знаем IP устройства, и нужно дистанционно определить, к какому из портов коммутатора оно подключено.
Памятка по командам, для тех кто знает процедуру:
Последовательность действий по шагам:
1. Сначала нужно определить MAC-адрес устройства. Для этого на любом устройстве, которое понимает маршрутизацию (использует протокол IP), нужно посмотреть таблицу arp. Перед этим обязательно нужно послать пакет на устройство (например, сделать ping на него откуда-нибудь). Чтобы посмотреть таблицу arp на маршрутизаторе Cisco 831, нужно дать команду show arp. На компьютере с w2k нужно дать команду arp -a, на *nix команду arp -n.
2. На коммутаторе (С2950) выполнить команду show mac-address-table. Будет выведена примерно такая таблица:
Switch-2950-a.b.96.253#show mac-address-table
Mac Address Table
——————————————-
Vlan Mac Address Type Ports
—- ———– ——– —–
All 0015.fa4c.d680 STATIC CPU
All 0100.0ccc.cccc STATIC CPU
All 0100.0ccc.cccd STATIC CPU
All 0100.0cdd.dddd STATIC CPU
50 000a.e475.7469 DYNAMIC Fa0/5
50 000a.e476.4515 DYNAMIC Fa0/7
50 0012.01bb.4add DYNAMIC Fa0/1
Total Mac Addresses for this criterion: 7
Теперь осталось сравнить таблицу IP-MAC (полученную на предыдущем шаге) с этим выводом, и будет понятно, к какому порту подключено устройство (выстраиваем цепочку IP-MAC-port).
В случае, когда между нами и устройством стоит цепочка из коммутаторов, нужно использовать следующий метод. Предположим, нужно найти, к какому порту какого коммутатора подключено устройство с IP a.b.0.61.
1. Для начала заходим на корневой коммутатор, и даем команду
Это нужно для того, чтобы гарантировать появление в ARP-таблице MAC-адреса искомого устройства.
2. Даем команду показать ARP-таблицу:
В первой строке Получим MAC устройства с IP a.b.0.61 – 000a.e475.a1a1
3. Даем команду показать таблицу перенаправления MAC-адресов:
#show mac-address-table address 000a.e475.a1a1
Получим имя интерфейса, через который идет трафик на 000a.e475.a1a1 – Gi6/14. Теперь смотрим на имя интерфейса. Если на этом этапе обнаружится, что интерфейс не физический, а Port-channel, то тогда нужно узнать список физических интерфейсов, входящих в этот Port-channel, и для каждого из них повторить шаг 4, пока не будет получен IP соседней циски.
Список интерфейсов в Port-cahnnel можно узнать, дав команду show running-config и просмотрев подкоманду “channel-group номер_группы” у интерфейсов, или дать команду show etherchannel summary.
4. Итак, мы получили имя интерфейса, через который идет трафик искомого хоста и уверены в том, что он не конечный (подключен через один или несколько коммутаторов). В этом случае даем команду нашему коммутатору показать соседей, подключенных по найденному интерфейсу:
#show cdp neighbors GigabitEthernet 6/14 detail
В случае наличия соседей получим IP циски, с которой соединяется GigabitEthernet 6/14 – a.c.0.35. Если соседей нет, то порт конечный (к нему и подключено устройство с искомым IP).
5. Коннектимся к a.c.0.35, и повторяем шаги 1..3. В итоге команда
50 000a.e475.a1a1 DYNAMIC Fa0/10
1. Как определить IP хоста, подключенного к определенному порту коммутатора.
Updated: by
The arp command displays, adds, and removes arp information from network devices.
Availability
Interface 220.0.0.80
Internet Address Physical address Type
220.0.0.160 00-50-04-65-F7-23 static
The physical address or MAC address as shown above in the format aa-bb-cc-dd-ee-ff is the unique manufacturer identification number. This number should always be a unique address.
arp -s 220.0.0.161 00-50-04-62-F7-23
Above, is an example of how to change the above IP address 220.0.0.160 to 220.0.0.161.
If an IP address has already been assigned to the specific network adapter, it is not possible to change that assigned IP address to a new address. DHCP, BOOTP or RARP networks automatically assign the card an IP address. Therefore, this command would not be utilized.
Маршрутизаторы передают пакеты по какому-либо логическому пути, который состоит из определённого количества каналов передачи данных, “читая” и “взаимодействуя” с сетевыми адресами. Пакеты, инкапсулированные в кадры (фреймы), передаются через канальную среду. Фреймы содержат уникальные идентификаторы канальной среды (например, MAC-адреса) для определения адресата источника и назначения в канальной среде.
Устройствам в канальной среде необходим способ определения идентификаторов канальной среды соседей для того чтобы фреймы могли быть отправлены корректному адресату назначения. Одним из таких механизмов определения для протокола IP версии 4 является протокол ARP – Address Resolution Protocol, описанный в RFC 826.
Основы работы протокола ARP
На рисунке 1 изображён процесс работы протокола ARP

Пакет ARP Request инкапсулируется в фрейм. В качестве MAC-адреса источника выступает сам источник, в качестве MAC-адреса назначения используется broadcast адрес (FFFF.FFFF.FFFF).
Вот как выглядит ARP Request если захватить его с помощью wireshark

Подробно рассмотреть каждое поле запроса ARP можно скачав данный дамп
Broadcast адрес используется для того чтобы все узлы в канальной среде получили данный фрейм и обработали инкапсулированный внутри пакет. Все устройства, за исключением адресата назначения, поймут, что данный пакет не предназначается для них и попросту отбросят его. Устройство назначения обработает пакет и в ответ отправит ARP Reply адресату источника. Внутри ARP Reply будет содержаться как раз-таки MAC-адрес адресата назначения.
На следующем изображении можно увидеть как выглядит ARP Reply

Также скачав дамп с трафиком можно более подробно увидеть каждое поле пакета
Структура полей протокола ARP
Протокол ARP имеет следующие поля:

Формат протокола ARP
Стоит напомнить, что формат протокола обычно показывается в разрезе 4 байт. Из-за этого часть информации из полей протокола может быть показана как часть следующих 4 байт (на примере Hardware и IP адресации).
Hardware Type – 16-битное поле, определяющее “тип канальной среды”. Наиболее часто используемые типы представлены в таблице ниже
Но основную часть всё же занимает именно Ethernet.

Protocol Type – 16-битное поле, определяющее протокол сетевого уровня, который отправитель связывает с идентификатором канала передачи данных. Для протокола IP версии 4 значение данного поля равно 0x0800

Hardware Address Length – 8-битное поле, определяющее длину идентификатора канальной среды в байтах. MAC-адреса имеет длину 48 бит или 6 байт.


Protocol Address Length
Operation – 16-битное поле, которое определяет какой тип пакета ARP используется:


MAC + IP адреса
Практика
Посмотрим небольшую практику на примере следующей схемы:

Для того чтобы отследить пакеты arp на устройствах cisco можно воспользоваться утилитой debug. Для этого необходимо в привилегированном режиме выполнить команду debug arp
Важно: команда debug очень требовательна к ресурсам, следует аккуратно использовать её на производстве. При неаккуратном задании параметров можно потерять доступ к устройству из-за постоянного спама сообщений в консоль.
Для просмотра таблицы ARP на устройствах cisco можно выполнить команду show arp в привилегированном режиме. Для операционной системы Windows можно выполнить команду arp -a, а для Linux команда выглядит arp -vn. Примеры выполнения команд приведены ниже:

Cisco ARP table

Windows ARP table

Linux ARP table
Стоит обратить внимание на колонку Age в выводе команды на маршрутизаторе. Данная колонка показывает через какое количество времени данная запись будет удалена из таблицы ARP. Это сделано для того чтобы предотвратить перегрузку таблицы ARP устаревшими записями.
Поведение по умолчанию можно изменить, выполнив следующий набор команд (настройка актуальна для отдельного интерфейса)
Для очистки ARP кэша можно выполнить команду
В следующий раз я вкратце рассмотрю другие разновидности протокола ARP: Proxy ARP, Gratuitous ARP, Reverse ARP.
P.S. вся информация представленная здесь используется исключительно в образовательных целях. Все совпадения с реальными объектами, адресами, именами и т.д. случайна и не несёт цели получить от этого выгоду или причинить кому-либо вред.
Back to top ↑
Предназначается для организации вывода, а также дальнейшего изменения информации в кэше. Протокол включает в себя таблицы в количестве одной ил нескольких штук. Их задачей является записывание IP адресов и непосредственных физических типов адресов. Предполагается создание специальной таблицы для каждого всех сетевых адаптеров Ethernet и Token Ring, которые использованы на устройстве. Если выполнить запуск без каких-либо параметров, будет выдана справочная нформация.
Синтаксис
Особенности указанных значений и параметров полностью совпадают с вариантом -а.
Позволяет удалить конкретную запись на основании указанного IP адреса. Если требуется осуществить одновременное удаление сразу всех записей, требуется только поставить символ звездочки (*) на место «интернет_адрес».
Производит добавку статической записи. Её задачей считается сопоставление IP адреса (интернет_адрес) с используемым физическим адресом (е_адрес ).
Позволяет получить справку через командную строку.
Заметки
- Для записи всех IP адресов требуется применять точечно-десятичный вариант.
- Для физического адреса (е_адрес ) предполагается использование специальной формы записи. Он должен занимать 6 байт, а его запись осуществляется 16-тиричном формате.
- Если запись обладает параметром S, то не предусматривается дальнейшего удаления из кэша компьютера. Подобные действия происходят в тех ситуациях, когда произошел запуск TCP/IP протоколов.
- Допускается использовать ARP команду при установке особых свойств сетевого адаптера. Предполагается в сетевых подключениях задавать протокол TCP/IP.
Примеры использования команды
Достаточно ввести в командную строку arp –a и результатом станет вывод таблиц кэша для полного списка интерфейсов. Следует рассмотреть варианты для конкретных запросов. Для IP адреса 12.0.0.22 следует осуществлять ввод arp -a -N 12.0.0.22. Если нужно выполнить сопоставление физического адреса 11-BB-11-5A-FF-8C и указанного ранее IP адреса, производится ввод arp – 12.0.0.22 11-BB-11-5A-FF-8C.
Настройка
This command show Address Resolution Protocol (ARP) entries for the .
This example shows configured static ARP entries for the .
Protocol Address Hardware Address Interface
Internet 10.3.129.98 00:1A:1E:C0:80:28 vlan1
Internet 10.3.129.253 00:0B:86:42:35:80 vlan1
Internet 10.3.129.250 00:1A:92:45:DB:00 vlan1
Internet 10.3.129.99 00:1A:1E:C0:1C:60 vlan65
Internet 10.3.129.96 00:1A:1E:C0:80:1E vlan65
Internet 10.3.129.254 00:0B:86:02:EE:00 vlan1
Related Commands
arpThis command adds a static Address Resolution Protocol (ARP) entry.
Command History
ArubaOS 8.0.0.0Command introduced.
Command Information

Что такое протокол ARP?
В TCP/IP не рассматриваются технологии канального и физического уровней, при реальной передаче данных все равно приходится отображать IP адрес на адрес канального уровня.


Непосредственно связь между IP адресом и MAC адресом осуществляется с помощью так называемых ARP-таблиц, где в каждой строке указывается соответствие IP адреса MAC адресу.
Пример ARP-таблицы в ОС Windows представлен на рисунке.

В ARP-таблице, помимо IP и MAC адреса, еще указывается тип связи, существует два типа записей:
- Статические записи создаются вручную, они существуют до тех пор, пока компьютер или маршрутизатор остается включенным.
- Динамические записи должны периодически обновляться. Если запись не обновлялась в течении определенного времени (приблизительно 2 минуты), то она исключается из таблицы. В ARP-таблице содержаться записи не обо всех узлах сети. А только те, которые активно участвуют в сетевых операциях. Такой способ хранения называется ARP-кэшем.
В IPv6 функциональность ARP обеспечивает протокол NDP (Neighbor Discovery Protocol Протокол Обнаружения Соседей).

Существует четыре типа ARP-сообщений:
- ARP-запрос (ARP request);
- ARP-ответ (ARP reply);
- RARP-запрос (RARP-request);
- RARP-ответ (RARP-reply).
Структура заголовка ARP

- Hardware type (HTYPE) Каждый канальный протокол передачи данных имеет свой номер, который хранится в этом поле. Например, Ethernet имеет номер 0x0001
- Protocol type (PTYPE) Код сетевого протокола. Например, для IPv4 будет записано 0x0800
- Hardware length (HLEN) Длина физического адреса в байтах. Адреса Ethernet имеют длину 6 байт.
- Protocol length (PLEN) Длина логического адреса в байтах. IPv4 адреса имеют длину 4 байта.
- Operation Код операции отправителя: 1 в случае запроса и 2 в случае ответа.
- Sender hardware address (SHA) Физический адрес отправителя.
- Sender protocol address (SPA) Логический адрес отправителя.
- Targethardwareaddress (THA) Физический адрес получателя. Поле пусто при запросе.
- Target protocol address (TPA) Логический адрес получателя.
Рассмотрим структуру заголовка ARP запроса (request) на примере перехваченного пакета с помощью сетевого анализатора Wireshark

Рассмотрим структуру заголовка ARP ответа (reply) на примере перехваченного пакета с помощью сетевого анализатора Wireshark

Contents
arp-scan is a command-line tool for system discovery and fingerprinting. It constructs and sends ARP requests to the specified IP addresses, and displays any responses that are received.
arp-scan allows you to:
- Send ARP packets to any number of destination hosts, using a configurable output bandwidth or packet rate.
This is useful for system discovery, where you may need to scan large address spaces. - Construct the outgoing ARP packet in a flexible way.
arp-scan gives control of all of the fields in the ARP packet and the fields in the Ethernet frame header. - Decode and display any returned packets.
arp-scan will decode and display any received ARP packets and lookup the vendor using the MAC address. - Fingerprint IP hosts using the arp-fingerprint tool.
Introduction to the ARP protocol
ARP (Address Resolution Protocol) is a protocol that determines the link-layer (layer-2) address for a given network layer (layer-3) address. ARP is defined in RFC 826 An Ethernet Address Resolution Protocol.
The ARP protocol is designed to allow it to be used for any link-layer and network-layer protocols. However in practice it is only used for Ethernet (including 802.11 wireless) and IPv4, and we assume these protocols throughout this document. IPv6 uses NDP (neighbour discovery protocol) instead, which is a different protocol.
ARP is a non-routable protocol, and can therefore only be used between systems on the same Ethernet network.
ARP Packet Diagram
The diagram below shows an example ARP packet within an Ethernet frame:

In the diagram, the packet is an ARP request (ar$op = 0001) for the IP address 10.0.0.2 (ar$tpa). It was sent from the system with MAC address 00:C0:9F:09:B8:DB (both MAC source address and ar$sha) and IP address 10.0.0.1 (ar$spa). The packet is sent to the all stations broadcast address FF:FF:FF:FF:FF:FF (MAC destination address).
And a raw hex dump of the packet, including the Ethernet MAC header is:
ff ff ff ff ff ff 00 c0 9f 09 b8 db 08 06 00 01
08 00 06 04 00 01 00 c0 9f 09 b8 db 0a 00 00 01
00 00 00 00 00 00 0a 00 00 02
The two tables below describe the fields in the Ethernet MAC header and the ARP protocol data.
The length of the MAC header is 14 bytes (112 bits).
ARP Protocol Data Fields
arp-scan works on Ethernet and 802.11 wireless networks. It may also work with token ring and FDDI, but they have not been tested. It does not support serial links such as PPP or SLIP, because ARP is not supported on them.
You will need to be root, or arp-scan must be SUID root, in order to run arp-scan, because the functions that it uses to read and write Ethernet packets require root privilege.
Discovering all hosts on the local network
If the system you are testing from has an address on the network you wish to scan, the simplest way to scan it is with a command similar to:
arp-scan –interface=eth0 –localnet
Here, –interface=eth0 represents the interface to use for scanning, and –localnet makes arp-scan scan all possible IP addresses on the network connected to this interface, as defined by the interface IP address and netmask. You can omit the –interface option, in which case arp-scan will search the system interface list for the lowest numbered, configured up interface (excluding loopback).
The network interface name depends on the operating system you are using, the network type (Ethernet, Wireless Etc), and for some operating systems on the interface card type as well. In this document, the interface name eth0 is used for examples except where a different network type is being discussed.
All arp-scan options have both a long form like –interface=eth0 and a corresponding short form like -I eth0. I always use the long form in this document for clarity.
Here is an example showing arp-scan being run against the local network:
$ arp-scan –interface=eth0 –localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.5.2 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 00:c0:9f:09:b8:db QUANTA COMPUTER, INC.
192.168.1.4 00:02:b3:bb:5c:09 Intel Corporation
192.168.1.3 00:02:b3:bb:66:98 Intel Corporation
192.168.1.5 00:02:a5:90:c3:e6 Compaq Computer Corporation
192.168.1.6 00:c0:9f:0b:91:d1 QUANTA COMPUTER, INC.
192.168.1.8 00:02:b3:3d:13:5e Intel Corporation
192.168.1.9 00:02:b3:bb:66:bd Intel Corporation
192.168.1.10 00:02:b3:63:cd:16 Intel Corporation
192.168.1.12 00:02:a5:de:c2:17 Compaq Computer Corporation
192.168.1.13 00:02:b3:91:4e:74 Intel Corporation
192.168.1.14 00:02:a5:a9:27:29 Compaq Computer Corporation
192.168.1.17 00:12:3f:ae:c1:df Dell Inc
192.168.1.19 00:90:27:43:c0:57 INTEL CORPORATION
192.168.1.24 00:12:3f:d4:3c:06 Dell Inc
192.168.1.29 00:08:74:c0:89:1d Dell Computer Corp.
192.168.1.34 00:08:74:c0:40:ce Dell Computer Corp.
192.168.1.36 00:0c:29:d0:a2:18 VMware, Inc.
192.168.1.44 00:18:8b:7a:fe:10 Dell
192.168.1.47 00:12:3f:d4:41:86 Dell Inc
192.168.1.105 00:13:72:09:ad:76 Dell Inc.
192.168.1.148 00:90:27:9d:2a:0b INTEL CORPORATION
192.168.1.155 00:10:db:74:d0:52 Juniper Networks, Inc.
192.168.1.189 00:14:38:93:93:7e Hewlett Packard
192.168.1.191 00:01:e6:57:8b:68 Hewlett-Packard Company
192.168.1.195 00:10:83:f2:83:76 HEWLETT-PACKARD COMPANY
192.168.1.196 00:30:c1:ae:31:5c HEWLETT-PACKARD
192.168.1.204 00:11:43:0f:f2:dd DELL INC.
192.168.1.202 00:d0:b7:25:61:6c INTEL CORPORATION
192.168.1.222 00:90:27:9d:48:90 INTEL CORPORATION
192.168.1.192 00:01:e6:27:27:6e Hewlett-Packard Company
192.168.1.234 00:c0:9f:0d:00:9a QUANTA COMPUTER, INC.
192.168.1.251 00:04:27:6a:5d:a1 Cisco Systems, Inc.
192.168.1.250 00:06:d7:55:0f:40 Cisco Systems, Inc.
34 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.5.2: 256 hosts scanned in 1.717 seconds (149.10 hosts/sec). 33 responded
Here arp-scan scans the 192.168.1.0/24 network attached to eth0. It sends an ARP request for each IP address in the attached network (including the network and broadcast addresses) and for each host that responds, it displays the host’s IP address, MAC address and the vendor string corresponding to the MAC address (this is generally determined by the first three bytes of the MAC address).
Any hosts that respond to the ARP request are displayed in the format:
The IP address, Hardware address and vendor details are each separated by a single TAB character.
There is always a single blank line between the last responding system and the statistics display.
arp-scan will never report the scanning host’s own IP address, because the testing system won’t respond to its own ARP request. This is generally the desired behaviour, as we are almost never interested in the details of the testing system.
Although arp-scan reports the datalink type as EN10MB, this does not necessarily mean that it is 10Mbit Ethernet; it could by any type (10Mbit, 100Mbit, 1Gbit or 802.11a/b/g). EN10MB is the name used by libpcap for all types of Ethernet.
Specifying a list of IP addresses
It is possible to specify a list of IP addresses to send ARP requests for instead of using –localnet to specify all the addresses within the attached network. There are five ways to specify the list of target addresses:
- Specify a list of IP addresses as arguments, e.g. arp-scan –interface=eth0 192.168.1.1 192.168.1.2 192.168.1.3
- Read the list of IP addresses from a file, e.g. arp-scan –interface=eth0 –file=ip-address-list.txt
It is possible to use hostnames instead of IP addresses, e.g. arp-scan –interface=eth0 orion. This will lookup the IP address for orion with gethostbyname(). It is possible to disable this, so that all arguments must be IP addresses, with the –numeric option. In this case, the inet_pton() function is used to convert the IP address string.
The –numeric option is useful when DNS is not working, where it can avoid long delays caused by failed DNS lookups. If you find that arp-scan is taking a long time to run, this is one of the first things to try.
Don’t forget that the ARP protocol only works on the local Ethernet segment, and cannot be routed. So you cannot use arp-scan to discover hosts behind routers with the exception of remote interfaces on some multi-homed systems, and proxy-arp responses from routers.
Here is an example showing arp-scan being run against the eight addresses in the network 192.168.1.0/29:
$ arp-scan –interface=eth0 192.168.1.0/29
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.5.2 with 8 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 00:c0:9f:09:b8:db QUANTA COMPUTER, INC.
192.168.1.3 00:02:b3:bb:66:98 Intel Corporation
192.168.1.4 00:02:b3:bb:5c:09 Intel Corporation
192.168.1.5 00:02:a5:90:c3:e6 Compaq Computer Corporation
192.168.1.6 00:c0:9f:0b:91:d1 QUANTA COMPUTER, INC.
6 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.5.2: 8 hosts scanned in 0.885 seconds (9.04 hosts/sec). 5 responded
Using an interface without an IP address
You can still use arp-scan even if the interface does not have an IP address. If you use arp-scan in this way, it will use the IP address of 0.0.0.0 for the ar$sha field in the ARP packet unless you specify the IP address to use with the -arpsha option.
Some operating systems will only respond to ARP requests if the IP address specified in the ar$sha field is plausible. The exact rules vary between operating systems, but the most common is that the address in ar$sha must be within the IP network of the interface that the ARP request is received on. This is explored further in the fingerprinting section.
The list of target hosts is stored in memory. Each host in this list uses 28 bytes of memory, so scanning a Class-B network (65,536 hosts) requires about 1.75MB of memory for the list, and scanning a Class-A (16,777,216 hosts) requires about 448MB.
Timing and bandwidth usage
One ARP packet is sent for each for each target host, with the target protocol address (the ar$tpa field) set to the IP address of this host. If a host does not respond, then the ARP packet will be re-sent once more. The maximum number of retries can be changed with the –retry option. Reducing the number of retries will reduce the scanning time at the possible risk of missing some results due to packet loss.
You can specify the bandwidth that arp-scan will use for the outgoing ARP packets with the –bandwidth option. By default, it uses a bandwidth of 256000 bits per second. Increasing the bandwidth will reduce the scanning time, but setting the bandwidth too high may result in an ARP storm which can disrupt network operation. Also, setting the bandwidth too high can send packets faster than the network interface can transmit them, which will eventually fill the kernel’s transmit buffer resulting in the error message: No buffer space available. Another way to specify the outgoing ARP packet rate is with the –interval option, which is an alternative way to modify the same underlying parameter.
The time in seconds to perform a single-pass scan (i.e. with –retry=1) is given by:
time = n*i + t + o
Where n is the number of hosts in the list, i is the time interval between packets (specified with –interval, or calculated from –bandwidth), t is the timeout value (specified with –timeout) and o is the overhead time taken to load the targets into the list and read the MAC/Vendor mapping files. For small lists of hosts, the timeout value will dominate, but for large lists the packet interval is the most important value.
With 65,536 hosts, the default bandwidth of 256,000 bits/second (which results in a packet interval of 2ms), the default timeout of 100ms, and a single pass (–retry=1), and assuming an overhead of 1 second, the scan would take 65536*0.002 + 0.1 + 1 = 132.172 seconds, or about 2 minutes 12 seconds.
Using arp-scan for system fingerprinting
In addition to system discovery, you can also use arp-scan to perform various types of system fingerprinting as detailed below. This is particually useful on Firewalls and systems employing IP ingress filtering that do not have any accessible IP network services.
MAC Vendor Decoding
Unless the –quiet option is specified, arp-scan decodes the vendor details from the MAC address and displays these details in the third column, after the MAC address. Below is an example using a Cisco router where the vendor details are Cisco Systems, Inc.
arp-scan uses data from three files to decode the vendor details:
- ieee-oui.txt – This the IEEE OUI (Organizationally Unique Identifier) list, which is obtained from the IEEE website and can be updated with the get-oui script that is included with arp-scan.
- mac-vendor.txt – This is a list of other MAC address / vendor mappings. This list is manually maintained, and is much smaller than the OUI and IAB listings.
When arp-scan starts up it reads the contents of all three files into a hash table, and it matches the MAC addresses of any ARP replies that it receives against this hash table to decode the vendor string.
The vendor details can often help to identify the device type. In the example above, the vendor string Cisco Systems, Inc. suggests that the device is a Cisco.
The vendor details depend on the manufacturer of the network interface, which may well be different from the manufacturer of the entire system, e.g. a 3COM Ethernet card in an HP server.
Differences in responses to non-standard ARP packets
Different IP stack implementations respond differently to non-standard ARP packets. arp-scan includes the arp-fingerprint tool that uses these differences to fingerprint the implementation. arp-fingerprint is a Perl script, which uses arp-scan to send and receive the ARP packets. The table below shows the tests that arp-fingerprint performs:
Each of these tests results in a yes/no answer depending on whether the target host responded or not. arp-fingerprint constructs a string of binary digits from the responses to the tests, with a response being encoded as “1” and no response being “0”, and uses the resultant binary string to match against a list of known fingerprints.
Below are some examples of arp-fingerprint being used against some different targets. arp-fingerprint displays the IP address, the binary fingerprint string, and a list of known systems that match this fingerprint:
$ arp-fingerprint -o “–interface=eth0 –numeric” 192.168.1.1
192.168.1.1 01000100000 Linux 2.2, 2.4, 2.6
$ arp-fingerprint -o “–interface=eth0 –numeric” 192.168.1.204
192.168.1.204 11110100000 FreeBSD 5.3, Win98, WinME, NT4, 2000, XP, 2003
$ arp-fingerprint -o “–interface=eth0 –numeric” 192.168.1.251
192.168.1.251 00000100000 Cisco IOS 11.2, 11.3, 12.0, 12.1, 12.2, 12.3, 12.4
$ arp-fingerprint -o “–interface=eth0 –numeric” 192.168.1.155
192.168.1.155 01000111111 ScreenOS 5.0, 5.1, 5.3, 5.4
In each of the examples above we use arp-fingerprint’s -o option to pass the –interface=eth0 –numeric option string to arp-scan. The -o option can be used to pass any options to arp-scan, with the two most common ones being –interface to specify the network interface and –numeric to avoid DNS lookups.
Sometimes, an operating system can give different fingerprints depending on the configuration. An example is Linux, which will respond to a non-local source IP address if that IP is routed through the interface being tested. This is both good and bad: on one hand it makes the fingerprinting task more complex; but on the other, it can allow some aspects of the system configuration to be determined.
Changing the destination MAC Address
arp-scan sends the ARP requests to the Ethernet broadcast address ff:ff:ff:ff:ff:ff by default, but this can be changed with the –destaddr option.
An interface that is not in promiscuous mode will pass Ethernet packets to the operating system if the destination address is one of:
- The Ethernet broadcast address ff:ff:ff:ff:ff:ff;
- The interface’s unicast address; or
- An Ethernet multicast address that the system is listening on.
You can always use the target system’s MAC address as the target if you know it. This can be useful to check that a given system with known IP and MAC addresses is present on the LAN, and it has the advantage that it is quieter than using the broadcast because it won’t be received by all network stations.
Below is an example of using a host’s unicast MAC address. In this example, we first use arp-scan with the default broadcast destination to determine the host’s MAC address, and then run arp-scan again specifying the host’s MAC address as the detination.
$ arp-scan –interface=eth0 192.168.1.1
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.5.2 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 00:c0:9f:09:b8:db QUANTA COMPUTER, INC.
$ arp-scan –interface=eth0 –destaddr=00:c0:9f:09:b8:db 192.168.1.1
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.5.2 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 00:c0:9f:09:b8:db QUANTA COMPUTER, INC.
If you send the ARP requests to an Ethernet multicast address it will only be received by those systems that are listening on that multicast address, or have set their Ethernet interface into promiscuous mode (and therefore receive all packets). This can be used to find systems that are running in promiscuous mode, or listen on particular multicast addresses.
The table below shows some common Ethernet multicast addresses:
Detecting Systems Listening to OSPF Multicasts
This example shows the use of the –destaddr option with the OSPF multicast address to detect systems listing to OSPF multicasts.
First we scan three systems using the default options. The IP addresses are 192.168.1.1, 192.168.1.204 and 192.168.1.254, which are running Linux 2.6.19, Windows 2003 and Cisco IOS 12.2(29) respectively. All three systems respond as expected.
$ arp-scan –interface=eth0 192.168.1.1 192.168.1.204 192.168.1.254
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.6.2 with 3 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 00:c0:9f:09:b8:db QUANTA COMPUTER, INC.
192.168.1.204 00:11:43:0f:f2:dd DELL INC.
192.168.1.254 00:60:5c:f4:c6:f4 CISCO SYSTEMS, INC.
Next we scan the same systems, but specify –destaddr=01:00:5e:00:00:05 to set the Ethernet destination address to the OSPF multicast address. Only the Cisco router responds, because that is the only system that is listening to the OSPF multicast address.
$ arp-scan –interface=eth0 –destaddr=01:00:5e:00:00:05 192.168.1.1 192.168.1.204 192.168.1.254
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.6.2 with 3 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.254 00:60:5c:f4:c6:f4 CISCO SYSTEMS, INC.
Detecting Promiscuous Mode Interfaces
Next we scan the same systems, but specify –destaddr=01:00:01:02:03:04 to set the Ethernet destination address to an unassigned multicast address. Only the Linux system responds, because it is running tcpdump which has put its Ethernet interface into promiscuous mode.
$ arp-scan –interface=eth0 –destaddr=01:00:01:02:03:04 192.168.1.1 192.168.1.204 192.168.1.254
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.6.2 with 3 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 00:c0:9f:09:b8:db QUANTA COMPUTER, INC.
ARP Ethernet Frame Padding
The diagram below shows an ARP packet within an Ethernet frame with padding to achieve the minimum Ethernet frame size.
![]()
ARP packet showing Ethernet frame padding
arp-scan can add arbitary padding data to the outgoing ARP requests with the –padding option. If the –verbose option is specified, then arp-scan will report any non-zero padding on received ARP responses.
Most implementations will pad up to the minimum frame length with zero bytes, but not all implementations do this. Below are some examples of systems that return non-zero padding bytes:
In the example above, the systems are:
I have not performed much investigation on ARP frame padding, and I suspect that there are more oddities waiting to be discovered.
802. 2 LLC/SNAP Framing
By default, arp-scan sends ARP requests using Ethernet-II Ethernet framing, which is the standard Ethernet framing for TCP/IP. If the –llc (-L) option is specified, then arp-scan will send ARP requests using IEEE 802.2 LLC/SNAP Framing instead, as defined in RFC 1042 “Standard for the transmission of IP datagrams over IEEE 802 networks”.
![]()
ARP Packet with 802.2 LLC/SNAP Framing
Irrespective of whether the –llc option is specified, arp-scan will always receive ARP responses in either Ethernet-II or 802.2 format, and will display “(802.2 LLC/SNAP)” to indicate an 802.2 format ARP response.
The 802.2 LLC/SNAP framing detailed in RFC 1042 is applicable to three underlying physical networks: 802.3 (Ethernet), 802.4 (Token Bus) and 802.5 (Token Ring). However the current version of arp-scan only supports Ethernet, and cannot be used for 802.4 or 802.5 networks.
The 802.2 LLC framing is obsolete, and is almost never seen on a real world network. But some network stacks still support it, especially routers, which need to be able to communicate with a diverse range of equipment, and operating systems with a history of use on networks using 802.2 LLC.
Here is an example from Windows Vista SP1. Although Windows systems support ARP requests with SNAP framing, they respond with standard Ethernet-II framing.
$ arp-scan –llc 192.168.1.50
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.7 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.50 00:1d:09:94:3e:5f Dell Inc
Here is an example from a Cisco router running IOS 12.2. Cisco IOS will respond to an ARP request in SNAP format with an ARP reply in SNAP format.
$ arp-scan –llc 192.168.124.251
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.7.1 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.124.251 00:04:27:6a:5d:a1 Cisco Systems, Inc. (802.2 LLC/SNAP)




