This is a PoC script to find active machines in a port range with Python.
The whole idea is to use the ICMP protocol and check the ECHO_REPLY
state, if it's found, it will "reply" with a string that starts with "bytes from: "
The ICMP protocols works on the link layer, however, it can be used in the application layer as well.
The 'Subprocess' module is required to run the /bin/ping -c 1
commands directly from Python, and for redirecting data output, error and input to the programming logic inside.