Search⌘ K
AI Features

Simple Packet Send and Response

Explore how to send and receive network packets using Scapy's sr() function. Understand how to interpret responses, manage unanswered packets, and leverage Scapy's automatic field population to build effective network communication tools essential for port scanning and honeypot development.

Sending packets with sr()

So far, we’ve been working with static packet captures, including reading and modifying their contents. However, if we want to build port scanners, honeypots, or servers, we need to be able to send and receive traffic over the network.

Luckily, Scapy has several different functions for doing this. We’ll start out by sending a single packet and looking for matching responses.

In the code block below, we’re using Scapy’s sr() function to ...