This is a static, read-only archive of Wireshark Q&A. Older questions and answers from October 2017 and earlier can be found at osqa-ask.wireshark.org.
0

Can this packet be filtered?

asked Dec 25 '25

updated Dec 26 '25

I have a large file with more than 90% of packets coming from one IP. If I was to filter based on IP, I would have to save 90% of the large capture file I have which I'd like to avoid.

Is there any way to specify just one packet with the following details that I got from my IDS?

TIME:              11/06/2025-16:57:44.496934
PKT SRC:           wire/pcap
SRC IP:            redacted1
DST IP:            redacted2
PROTO:             17
SRC PORT:          41893
DST PORT:          45547
FLOW:              to_server: FALSE, to_client: TRUE
FLOW Start TS:     11/06/2025-16:34:02.883356
FLOW PKTS TODST:   28056
FLOW PKTS TOSRC:   43406
FLOW Total Bytes:  58085272
FLOW IPONLY SET:   TOSERVER: TRUE, TOCLIENT: TRUE
FLOW ACTION:       DROP: FALSE
FLOW NOINSPECTION: PACKET: FALSE, PAYLOAD: FALSE, APP_LAYER: FALSE
FLOW APP_LAYER:    DETECTED: TRUE, PROTO 34
PACKET LEN:        1494

Further clarification:

  1. I run an IDS and packet capture software simultaneously. What I've posted above is an alert from my IDS about a suspicious packet that it flagged.

  2. I have a packet capture file and I am using suricata as my IDS.

  3. Usually given an IDS alert similar to the above it's quite simple to go to Wireshark and zoom down to the troublesome single packet. I often use an expression like:

    frame.time == "2025-10-13 08:17:35.073949+0200"

  4. The above filter didn't produce any results this time. Using the data from the above IDS summary I've created the follwing filter which has narrowed my search. Of all the packets captured I've narrowed it down to 6.6%.

    (frame.time_epoch >= 1762448264) && (frame.cap_len == 1494) && (ip.src == redacted1) && (udp.srcport == 41893)

Question: Any ideas about how to zoom down even more?

Comments

What exactly is it you're trying to do?

Do you already have a file, and you want to extract that particular packet?

Or do you want to capture traffic from a network interface and capture packet that are just like that packet?

I'm guessing it's the first of those - in which case that's not what a capture filter would be used for in WIreshark or TShark.

User 87485 ( Dec 26 '25 )

Are the packets being decoded as cflow? (Display Filter Reference: Cisco NetFlow/IPFIX)

Which IDS is generating the log entry? Is there a mapping back to the netflow fields the data came from?
You may be able to filter on the SRC PORT, DST PORT, FLOW Start TS and FLOW APP_LAYER if they can be mapped to specific Wireshark fields.

User 2763 ( Dec 26 '25 )

@User 87485: Please see the information I've added to my question!

User 22376 ( Dec 26 '25 )

@User 2763: The src and dst port are the same for all 6.6% of the packets displaying. Haven't found a way to filter for flow app_layer.

User 22376 ( Dec 26 '25 )

I think ALPROTO_HTTP2 is 34 so that doesn't help to narrow it down.
AppProtoEnum defined in app-layer-protos.h

User 2763 ( Dec 26 '25 )

1 Answer

0

answered Dec 26 '25

You can configure Suricata to log the packet generating the Alert (packet=yes) and then you can extract it from the logging.

See also:

Would that fit your needs?

If not, you can filter on the items in the log entry, but it will never be an exact match, unless the timestamps of suricata exactly match the timestamps in the pcaps, which is next to impossible. As the packets pass the different processes separately. The best filter you can make is:

ip.src==<src> and ip.dst==<dst> and udp.srcport==<srcport> and udp.dstport==<dstport> and frame.len==<length> and frame.time_epoch >= <time from log> - <delta> and frame.time_epoch <= <time from log> + <delta>

Where you choose delta to be larger than the max time difference between the timestamps in suricata and the timestamps in the pcap file. Please note that you will need to use the timestamp including the microseconds.

cc-by-sa Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.