Chapter 3

Capturing Network Packets Using Python

Abstract

This chapter examines the rules of thumb necessary to setup a packet capture environment. In addition, I cover considerations for information capture, Python data type selection for observation storage along with the creation of classes for handling data storage, and retrieval of packet contents. Finally, the P2NMAP capture script is completed and ready for use to passively capture TCP and UDP packets.

Keywords

Packet Capture
TCP
UDP
Dictionary
Tuples
Signaling
Class
ServerIP
ClientIP
Port
Smart Switch
Monitoring
SYN
TOS
DF
TTL
WindowSize
promiscuous mode

“We are drowning in information, but starved for knowledge”

John Naisbitt

Get Python Passive Network Mapping now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.