How to use "Follow TCP stream" for specific packets in Wireshark? - tcp

I'm trying to build my filter in Wireshark to filter out unwanted packets. Currently filter looks like:
!(http.request.method == POST) && !(http or frame contains "aa" || http or frame contains "bb") && !(http.response.code == 404 or http.response.code == 301 or http.response.code == 302 or http.response.code == 303)
which means:
"show any traffic except: packets with a HTTP POST method and packets with payload contains strings "aa" or "bb" and packets with response codes 404 or 301 or 302 or 303"
And from my standpoint this filter works correctly and many packets is filtered out and I'm able to see only the most important packets. But now I would like to use "Follow TCP stream" on remaining most important packets. When I'm trying use "Follow TCP stream" option then wireshark is looking for TCP stream from whole pcap file instead of the most important packets after filtering.
Summarizing I don't want do "Follow TCP stream" for filtered out packets, just for remaining packets after filtering.
How I can resolve this issue?

"Follow TCP Stream" can only follow an entire TCP connection; it cannot show only data from selected packets from that connection. If you want the ability to show data from some but not all packets in a TCP connection, you would have to request that as an enhancement on the Wireshark Bugzilla.
As a workaround, you might be able to save the remaining packets to a file and open that file, and then try "Follow TCP Stream" on the packets in that file.

Unfortunately You can only "Follow TCP Stream" an entire TCP Connection, with all the packets from the connection.
The only avaiable filtering on TCP Stream is the ability to see a specific direction of a TCP:
From A -> B
From B ->A
this option can be selected at the "Follow TCP Stream" dialog box.

Related

How To know the Size of HTTPS or HTTP Packets except for Retransmission

It's about HTTP(s) or TCP protocol.
I am learning HTTP using Wireshark, I see lots of retransmission packets in TCP protocol. And I want to calculate the total size of data sent by client-end to server-end, except for retransmission.
How can I get the whole pure size of data I sent to server, except retransmission?
Is there any flag for retransmission in TCP protocol?
There's no "retransmission" flag it TCP. Finding retransmissions requires analyzing the sequence numbers of sent segments, which is something wireshark does - for instance, you can use the display filter tcp.analysis.retransmission to find TCP segments that wireshark considers to be retransmissions.
To find the amount of data sent in a tcp session, right click any segment from the session, and click Follow -> TCP Stream:
It'll generate a display filter such as tcp.stream eq 138 and show you the entire content of the selected tcp session, including the amount of shared data, regardless of retransmissions:

Tool to monitor complete TCP request and response

I need to performance test an application [BRM remedy, ar user] that is using an TCP protocol. I don’t have much knowledge on TCP Protocol.
I tried with wireshark to analyze the requests, but it is showing TCP request with data checks [Assuming that my data is splitting into small chunks by TCP protocol implementation].
Can you please suggest me some good tool that can monitor TCP requests and responses [like HTTP fiddler for HTTP Protocol]?
I will be using Jmeter for the perf testing.
You might be seeing packets in the TCP format , but you can docode your packet in wire share too.
Open your capture in wireshark go to Analyze -> Decode As -> and all request will will traslated accodingly.
If you want analyse a specific TCP stream or want to to which tcp stream a packet belong to , right click on packet and click "Follow tcp..." , you will be finding allthe packets belong that particular tcp stream.
It mostly work for me with above two functionality , hope same for you.

Decode packet data using bultin dissector

I have a protocol that exactly follows ipv6 header format and is encapsulated in udp for transmission. Is there any way to make wireshark decode the udp data as an ip packet?
There's a protocol called "Teredo Tunneling" (which see) which encapsulates/tunnels IPV6 in UDP packets (using UDP port 3544).
If your capture is of a UDP conversation using UDP port 3544 on one end of the conversation, then Wireshark should automatically recognize the conversation as Teredo (i.e., IPV6 over UDP) and properly decode the IPV6 payload in the UDP data.
If your capture is using a different UDP port, do the following to specify that a particular UDP conversation is to be decoded as Teredo:
Right click on a UDP frame you wish to decode as Teredo.
Select "Decode As" in the right-click menu.
Select the "Transport" tab in the "Decode As" pop-up window.
Select Teredo in the right-hand "decode as" column.
Click "OK".

Detecting retransmitted packet with libpcap

I'm filtering packets with libpcap with a filter like "tcp src localhost". It filters all the packets whose source is localhost (my host).
When localhost doesn't receive a TCP confirmation of an already sendt packet, localhost will forward the packet.
Not all the packets filtered by libpcap will arrive to its destination, and I need to identify when a packet is a "forwarded packet". Is there any way with libpcap to identify a forwarded packet?
By my understanding, you're looking for TCP retransmissions. These can be found by display fitters in wireshark after capturing. These two should help you:
Retransmitted packets can be found through the display filter tcp.analysis.retransmission (more such filters).
When the receiver gets an out-of-order packet (usually indicates lost packet), it sends a ACK for the missing seq number. This is a duplicate ACK and these can be found by using tcp.analysis.duplicate_ack (details).

Wireshark saving filter result

I have a pcap file captured from a network. Now everytime I try to view the HTTP packets I place "http" in the filter. Is there a way where I can only save the HTTP filtered packets and not the lower level protocols included in the packet such as TCP, IP, Ethernet, Frames.
Try exporting rather than saving. There is an option there for exporting only selected packets.

Resources