> python modify_layers.py -h
usage: modify_layers.py [-h] [-i PCAP] [-j] [-d] [-l (START,END)] [-e] [-6] [-4] [-f]
A script for modifying PCAP files.
options:
-h, --help show this help message and exit
-i PCAP, --input PCAP
Input pcap file.
-j, --rmjnprlayer Remove the Juniper Ethernet layer, located 12 bytes from the beginning of the packet.
-d, --dot1q Remove the VLAN 802.1Q layer.
-l (START,END), --rmlayer (START,END)
Remove layers/bytes using start and end offsets
-e, --addeth Add an Ethernet layer and utilize random MAC addresses.
-6, --toipv6 Converting the IPv4 pcap to IPv6. Utilize random IPv6 addresses.
-4, --toipv4 Converting the IPv6 pcap to IPv4. Utilize random IPv4 addresses.
-f, --fixchksum Explicitly fix the checksum of the pcap. Implicitly, this fix applies to all other
features/arguments.
>
> python modify_layers.py -i 802.1q.vlans.pcap -d
> python modify_layers.py -i jnpr-ethernet-layer.pcap -j
> python modify_layers.py -i jnpr-ethernet-layer.pcap -j -d
> python modify_layers.py -i jnpr-ethernet-layer.pcap -l "(0,12)"
> python modify_layers.py -i .\unittest_cases\no_ethernet.pcap -e
- By default, Wireshark will attempt to decode it as Ethernet, which is why you're seeing Ethernet at that layer, but it is invalid.
> python modify_layers.py -i .\unittest_cases\valid_ipv4_http.pcap -6
> python modify_layers.py -i .\unittest_cases\valid_ipv6_http.pcap -4
[Example 8]: Explicitly fix the checksum of the pcap. Implicitly, this fix applies to all other features/arguments.
> python modify_layers.py -i .\unittest_cases\invalid_tcp_chksum.pcap -f
- Windows 11
- Python 3.12
- Visual Studio Code 1.84