We can use ICMP packets to create a network scanner. As ICMP is not an IP protocol, we have to access the network stack directly. So, here we can use Scapy to generate an ICMP packet and send it to the host.
IP range/network scanner
Getting ready
To start the scraping, we have to install the required Python packages. Here we use Scapy for the packet generation. To install Scapy, we can use pip. As we are using Python 3, make sure to install Scapy for Python 3. Also install its dependency module, netifaces:
pip3 install scapy-python3 pip3 install netifaces