Written as part of self-study. The python library socket was used . Below I will present what was helpful to create the above application.
- Exterior Gateway Protocol in Hex format from list of IP protocol numbers and you should know something about packet reading
- If you run this program on Windows, you show this:
Traceback (most recent call last):
File "C:\packets_sniffer.py", line 165, in <module>
main()
File "C:\packets_sniffer.py", line 141, in main
sniffer_socket = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.htons(0x0003))
^^^^^^^^^^^^^^^^
AttributeError: module 'socket' has no attribute 'PF_PACKET'
If you want to run it on Windows, you should PF_PACKET change to AF_INET in socket.