I'm trying to write a program that sees who is on my subnet, for that I want to send ICMP message to all ip possible in my subnet.
My question is how to send ICMP message in python?
Thank you
I'm trying to write a program that sees who is on my subnet, for that I want to send ICMP message to all ip possible in my subnet.
My question is how to send ICMP message in python?
Thank you
What you are looking for is the great module scapy. With it, sending ICMP-packets is as easy as this:
>>> send(IP(dst="1.2.3.4")/ICMP())
Have fun! :-)
Scapy can be installed via pip or downloaded at PyPI. Maybe some hosts don't reply to ICMP ping requests, you could also try ARP in a local network.