READING CAPTURE FILE
READING PCAP DATA
#reading entire pcap data
root@dco:~$ tshark -r demo.pcapng
1 0.000000 145.254.160.237 ? 65.208.228.223 TCP 3372 ? 80 [SYN] Seq=0 Win=8760 Len=0 MSS=1460 SACK_PERM=1
2 0.911310 65.208.228.223 ? 145.254.160.237 TCP 80 ? 3372 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1380 SACK_PERM=1
3 0.911310 145.254.160.237 ? 65.208.228.223 TCP 3372 ? 80 [ACK] Seq=1 Ack=1 Win=9660 Len=0
#reading by count, show only the first 2 packets.
root@dco:~$ tshark -r demo.pcapng -c 2
1 0.000000 145.254.160.237 ? 65.208.228.223 TCP 3372 ? 80 [SYN] Seq=0 Win=8760 Len=0 MSS=1460 SACK_PERM=1
2 0.911310 65.208.228.223 ? 145.254.160.237 TCP 80 ? 3372 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1380 SACK_PERM=1 READING SPECIFIC PACKET
root@dco:~$ tshark -r Desktop/exercise-files/demo.pcapng -Y "frame.number == 29"
29 4.105904 65.208.228.223 ? 145.254.160.237 TCP 1434 80 ? 3372 [PSH, ACK] Seq=12421 Ack=480 Win=6432 Len=1380 [TCP segment of a reassembled PDU]
* the -Y flag in tshark is used to apply a display filter to the packets
being processed. it ensures that only packets matching the given filter
expression are displayedREADING AND WRITING FILTERED PCAP DATA
READING AND DISPLAYING PCAP DATA IN HEX/ASCII
it will be hard to spot anomalies with large data sets. reduce the number of packets prior to analysis
READING AND DISPLAYING PACKET DETAILS
displaying full packet details makes it difficult to investigate long and complex terminal output for each packet; however, this is helpful for in-depth packet analysis and scripting. only use the verbosity level after filtering the packets
Last updated