Complete the code to capture network packets using a common tool.
tcpdump -i [1]The tcpdump command uses -i to specify the network interface, such as eth0.
Complete the command to filter captured traffic by HTTP port.
tcpdump port [1]HTTP traffic commonly uses port 80.
Fix the error in the command to save captured packets to a file.
tcpdump -w [1]The -w option saves packets in pcap format, so the file should have a .pcap extension.
Fill both blanks to create a filter for TCP traffic from a specific IP.
tcpdump tcp and src [1] and dst port [2]
This command filters TCP packets from source IP 192.168.0.10 to destination port 80, which is common for HTTP.
Fill all three blanks to create a dictionary comprehension that maps IPs to packet sizes for packets larger than 100 bytes.
packet_counts = [1]: [2] for [3] in packets if len([3].data) > 100
This comprehension creates a dictionary where keys are source IPs (pkt.src_ip) and values are packet sizes (pkt.size) for packets larger than 100 bytes, iterating over each packet as pkt.