This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

FIN, ACK initiated by the server

1

Please help me in the following query.

I have a client opening and closing socket with server. Generally client send FIN packet to sever to close the session. But sometimes server initiates the FIN but its difficult to trace it in wireshark as I have to analyze long list of logs. So is there any filter I can use to narrow down my search.

I am looking for a FILTER when server initiates FIN, ACK.

asked 27 Sep '16, 04:45

singhmanpreet294's gravatar image

singhmanpree...
21113
accept rate: 0%


One Answer:

1

(tcp.flags.fin == 1) and (tcp.flags.ack == 1) and (ip.src == a.b.c.d), replacing a.b.c.d with the server's ip address.

answered 27 Sep '16, 04:59

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks for the answer. But it will still not filter out if server initiates FIN, ACK in the first place. It will show all the FIN, ACK packet irrespective of who initiated it.

So this filter wont be able to help me much.

(27 Sep '16, 09:12) singhmanpree...

So you only want packets with FIN, ACK and the client hasn't sent a FIN yet.

Unfortunately, filters only work on each individual packet to include or exclude it based on the values in that packet, they can't look backwards or forwards in the packet list for values in other related packets.

Wireshark does have a tool, MATE, that can be used to build associations between packets that might be able to help you.

(27 Sep '16, 09:55) grahamb ♦

So this is true but you could try the following:

  1. Use the filter from above to colorize the packets

  2. Use the following display filter TCP.flags.syn==1 and TCP.flags.fin==1

  3. Apply the stream Id as a column

  4. Sort the trace by stream id column

Now it should be easier to find the relevant fin packets

(27 Sep '16, 09:56) Christian_R