Question
Using Python, create a program called GetIP.py that reads from a file called Wshark.txt and that will extract the IP addresses. The IP addresses will
Using Python, create a program called GetIP.py that reads from a file called Wshark.txt and that will extract the IP addresses. The IP addresses will be outputted to a file called IPA.text, once for every line and will list the destination and source. The program must include the Checkline function, lists, and Split function. Cannot use regex, have to individually check the characters.
Input sample format-
Frame 1: 372 bytes on wire (2976 bits), 372 bytes captured (2976 bits) on interface 0 Ethernet II, Src: WesternD_08:dd:b1 (00:14:ee:08:dd:b1), Dst: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa) Destination: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa) Address: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast) Source: WesternD_08:dd:b1 (00:14:ee:08:dd:b1) Address: WesternD_08:dd:b1 (00:14:ee:08:dd:b1) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 192.168.1.180, Dst: 239.255.255.250 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) Total Length: 358 Identification: 0xfe2a (65066) Flags: 0x4000, Don't fragment Time to live: 4 Protocol: UDP (17) Header checksum: 0xc505 [validation disabled] [Header checksum status: Unverified] Source: 192.168.1.180 Destination: 239.255.255.250
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started