0

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

2
  • 1
    AFAIK massage isn't usually transmitted via ICMP Commented Apr 1, 2014 at 10:03
  • related: Pinging servers in Python Commented Apr 1, 2014 at 11:07

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, try it out & if it satisfies your needs please mark this thread as solved. CU

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.