With Address Resolution Protocol (ARP), we can find live internal hosts. We can write a script to scan for hosts in a given network with Scapy.
ARP Watcher
How to do it...
We can write a ARP Watcher with the following steps:
- Create an arp-scanner.py file and open it in your editor.
- We then have to import the required modules:
from scapy.all import *
- Now declare the variables for the script:
interface = "en0" ip_rage = "192.168.1.1/24" broadcastMac = "ff:ff:ff:ff:ff:ff"
- Now we can send ARP packets to all the IPs in the IP range, and get answered and unanswered packets.
- Create the ARP packet as follows:
pkt = Ether(dst=broadcastMac)/ARP(pdst = ip_rage)
The structure of the packet will...