scapy

Interactive packet manipulation and network protocol analysis tool

pipmacoslinuxwindows
Try with needOr install directly
Source

About

Scapy: interactive packet manipulation tool

Commands

scapy

Examples

capture and analyze network packets live$ scapy
craft and send custom network packets$ scapy -c 'IP(dst="192.168.1.1")/ICMP()/Raw(load="test").show()'
read and inspect packet capture files$ scapy -c 'pkts = rdpcap("capture.pcap"); pkts[0].show()'
scan network hosts and open ports$ scapy -c 'ans, unans = sr(IP(dst="192.168.1.0/24")/ICMP())'
run scapy scripts from Python files$ scapy -s script.py