![]() The code line numbers and appropriate explanation is provided below.Ģ.Captures tshark on the eth0 interface (sudo tshark –i eth0) with a read filter applied to capture IP packets with destination address in the header as 192.168.1.25(-R ip.dst=’=192.168.1.25’), retrieves the source IP address in the packets (-T fields –e ip.src), for 30 second duration (-a duration:30), and writes the source IP address values to the output.txt file (output.txt)ģ.Opens the command using the appropriate functionĤ.Opens the output.txt file, in which the IP addresses are written.Ħ.Starts a for loop for reading the lines in the file.Ĩ.Increments the count variable with 1, for every lines stripped.ĩ.Prints the number of IP addresses which sent packets to the Ubuntu system which is the count variable.ġ0. ![]() The details of the code and explanation is provided below. The code builds an IP monitor tool with Python using tshark, the command line of wireshark. ![]() ![]() The -A option of tcpdump prints each packet in human readable ASCII and happily deals with wireshark files and you can do it all from the command line: tcpdump -A -r stackoverflow.cap > stackoverflow.txt ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |