scapy
pcapy
sys
Run using Jupyter NoteBook or any Python IDE.
- Run the script
- It will ask you about the interface you want to sniff (nothing means default).
- It will also ask about the number of packets you want to capture (0 means continuous)
-
CTRL + C
will terminate the script. -
It will create a file named
packet_log.txt
in the default folder.
- Download and Install Npcap Free Edition.
A Packet manipulation program and library which is used to capture, create, manipulate, and analyze network packets at a low level using a simple and intuitive syntax.
pip install scapy
OR
pip install pcapy
sys is a built-in Python module that provides access to some variables used or maintained by the Python interpreter. It is used to
- Access to Command Line Arguments
- Access to Standard Streams
- Access to System-Specific Parameters and Functions
- Exit Functions
- Run as Administrator
- Check Npcap Installation
- Restart Pcap Service
- Update Scapy and Npcap
pip install --upgrade scapy