Scapy commands

Scapy provides us with many commands to investigate a network. We can use scapy in two ways: interactively within a terminal window or programmatically from a Python script by importing it as a library.

These are the commands that may be useful to show in detail the operation of scapy:

  • ls(): Displays all the protocols supported by scapy
  • lsc(): Displays the list of commands and functions supported by scapy
  • conf: Displays all configuration options
  • help(): Displays help on a specific command, for example, help(sniff)
  • show(): Displays the details of a specific packet, for example, Newpacket.show()

Scapy supports about 300 network protocols. We can have an idea with the ls() command:

scapy>ls()

The screenshot shows an execution ...

Get Mastering Python for Networking and Security now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.