Scapy is a powerful interactive tool that can be used to capture, analyze, manipulate, and even create protocol-compliant network traffic, which can then be injected into the network. Scapy is also a library that can be used in Python, thereby offering the capability to create highly effective scripts to perform network traffic handling and manipulation. We will demonstrate here how to use Scapy to perform discovery in layers 2, 3, and 4:
- First, we will use Scapy and Python to perform ARP discovery in layer 2.
- Next, we will use Scapy to inject and analyze ICMP traffic in layer 3.
- Finally, we will use Scapy and Python to perform layer 4 discovery using both UDP and TCP.