Python-based packet crafting and network manipulation framework for packet generation, sniffing, protocol analysis, and network attack development.
python3 {script} {flags} ๐ script ๐ flags python3 {script} {flags} Sandbox: execFile · Timeout: 300s
network.packet.craft network.sniff.traffic network.protocol.analyze network.attack.arp network.attack.dns network.attack.dhcp network.manipulation.ip | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
script | string | No | - | Python script file containing Scapy commands | - |
flag-i | string | No | - | Network interface | -i, --interface |
flag-t | string | No | - | Target IP or hostname | -t, --target |
count | integer | No | - | Number of packets to send or capture | -c, --count |
| Type | Description | MIME | Schema | Trust |
|---|---|---|---|---|
network.capture.pcap | Captured network packets in PCAP format | application/vnd.tcpdump.pcap | - | verified |
network.analysis.json | Packet analysis results as JSON | application/json | - | verified |
Inputs
network.target.ip Target IP address for packet destination
network.interface Network interface to use
network.port.number Target port number
Outputs
network.capture.pcap Captured or crafted packet data
network.analysis.json Protocol analysis results
raw_socket_accessnetwork_traffic Produces
network.capture.pcapnetwork.analysis.jsonConsumes
network.target.ipnetwork.interfacenetwork.port.number| Resource | Value |
|---|---|
| CPU | low |
| Memory | 64 MB |
| Network | medium |
| Disk I/O | low |
ICMP ping sweep
python3 -c "from scapy.all import *; sr1(IP(dst=\"10.0.0.1\")/ICMP(), timeout=2)" TCP SYN scan
python3 -c "from scapy.all import *; sr1(IP(dst=\"10.0.0.1\")/TCP(dport=80, flags=\"S\"), timeout=2)" ARP scan local network
python3 -c "from scapy.all import *; arp_request = ARP(pdst=\"10.0.0.0/24\"); result = srp(arp_request, timeout=2)[0]; result.summary()" Sniff traffic on interface
python3 -c "from scapy.all import *; packets = sniff(iface=\"eth0\", count=10); wrpcap(\"capture.pcap\", packets)" DNS query
python3 -c "from scapy.all import *; sr1(IP(dst=\"8.8.8.8\")/UDP(dport=53)/DNS(rd=1, qd=DNSQR(qname=\"example.com\")), timeout=2)" Scapy is a powerful Python library for packet manipulation, protocol analysis, and network attack development. It can craft arbitrary packets, sniff traffic, perform network scans, and implement custom protocols.
from scapy.all import *
# TCP SYN scan
ans = sr1(IP(dst="10.0.0.1")/TCP(dport=80, flags="S"), timeout=2)
print(ans.summary())
# ARP request
ans = srp(ARP(pdst="10.0.0.1"), timeout=2)[0]
for req, res in ans:
print(f"{res.psrc} - {res.hwsrc}")
# Simple packet sniffer
pkts = sniff(filter="tcp port 80", count=10)
wrpcap("http.pcap", pkts)