...

/

Defining Actions for Packets

Defining Actions for Packets

Learn how to define actions in response to particular types of packets sniffed from a network.

Introduction

Previously, we used Scapy’s sniff function to monitor traffic flowing over the network. With sniff, we can use BPF filters to identify packets of interest and send them to a function for further processing and analysis.

However, our current code only prints the contents of the packet. It doesn’t process the packet itself or take different actions for different types of packets.

This capability is essential if we want to build honeypots or servers using Python ...