Skip to content
All posts

· 9 min read

How to Use Wireshark with AI: tshark Output, Filters and Streams

Use Wireshark with Odin v1: paste tshark summaries, get display filters you can test, explain a suspicious stream, and check statistics the model gets wrong.

Wireshark can show you every packet on the wire, but it will not tell you which ten of the 400,000 packets matter. The usual path is a filter you half remember, a lot of scrolling and a search for "wireshark filter for ..." in another tab. A language model is a good partner for that loop: it can read a summary, suggest where to look, write the display filter and explain a stream in plain words. This guide shows how to use Odin v1 with Wireshark and its command line sibling tshark, and where you must compute or check things yourself.

What the model sees, and what it does not

Odin accepts text only. It cannot open a .pcap or .pcapng file, and it is not connected to Wireshark. You work from text that tshark prints, and you paste that text into the web chat or an API call. This is a better habit than it sounds: a summary of a few dozen lines is something the model can read well, while a raw capture is not.

Two things to settle before you paste anything:

  • Capture only traffic you are authorized to capture. Your own machine, a lab, or a network where you have written permission. Capturing other people's traffic without authorization can be illegal, however useful the capture would be.
  • Redact before you paste. A capture holds passwords sent over HTTP, FTP or Telnet, session cookies, email addresses, internal hostnames and IP addresses. API prompts and completions are not stored, but there is no reason to send what the analysis does not need. Replace real addresses with placeholders, and remove credentials and cookies from any stream you paste.

odin-v1 has a 1,000,000-token context window, but summaries get better answers than dumps. Aim for the part of the capture that answers your question.

Step 1: paste the summaries, not the packets

Start with the overview that tshark can print without showing a single payload. The protocol hierarchy shows what the capture is made of:

bash
tshark -r capture.pcapng -q -z io,phs

A trimmed synthetic example, written for this article:

text
Protocol Hierarchy StatisticsFilter:
eth                                      frames:1480 bytes:612340  ip                                     frames:1470 bytes:611020    udp                                  frames:213 bytes:24190      dns                                frames:213 bytes:24190    tcp                                  frames:1257 bytes:586830      tls                                frames:1190 bytes:571204      http                               frames:12 bytes:3120

Add the conversation tables for the protocols that matter, which list who talked to whom and how much:

bash
tshark -r capture.pcapng -q -z conv,tcptshark -r capture.pcapng -q -z endpoints,ip

Then ask the model to read them:

You are assisting a network analyst on an authorized investigation. Below are the protocol hierarchy and conversation tables from a packet capture of one workstation, with real addresses replaced by placeholders. Describe what this host was doing, which conversations are unusual in volume or protocol and why, and what I should look at next. Mark anything you cannot tell from these numbers as a guess.

A good answer reads the numbers as numbers. It might point out that 213 DNS frames are a small share of the traffic and look normal in size, that one TCP conversation moved far more bytes than the others, and that the 12 plain HTTP frames are worth a look because they are readable. It should also say what these summaries cannot tell it, such as what was inside the TLS traffic.

Step 2: ask for display filters, and test each one

The model turns a question into a filter faster than you can look up the field name. Describe the packets you want and the version of Wireshark you use:

Write Wireshark display filters, not capture filters, for: DNS queries only, TCP connection attempts that got no answer, HTTP requests to a specific host, and TLS client hellos with the server name shown. Give one line per filter with a one-sentence explanation.

Expect filters in this shape:

text
dns.flags.response == 0tcp.flags.syn == 1 && tcp.flags.ack == 0http.request && http.host == "files.example"tls.handshake.type == 1

Do not trust any of them until a tool has accepted them. Paste each into the Wireshark filter bar, where the bar turns green for valid syntax and red for invalid, or check from the command line. tshark prints an error for a filter it cannot parse:

bash
tshark -r capture.pcapng -Y "tcp.flags.syn == 1 && tcp.flags.ack == 0" -c 5

A valid filter is not the same as a correct one. The second filter above matches every first SYN, including successful connections. To find attempts that got no answer, you also need to compare them with the SYN-ACK packets. Ask the model what a filter does not match, and test it on a few packets you can verify by eye.

Step 3: explain a suspicious stream

Once a conversation stands out, extract that one TCP stream as text:

bash
tshark -r capture.pcapng -q -z follow,tcp,ascii,0

The final number is the stream index, which you can find in Wireshark under Analyze > Follow > TCP Stream or by filtering on tcp.stream. Redact it before pasting, because this output is the payload. Then ask for an explanation:

Below is one TCP stream from a packet capture, with credentials and personal data removed. Explain what protocol this is, what each side is doing, and whether anything looks like command and control, data transfer or a scan. Quote the lines your conclusions come from, and say what you cannot tell from this text.

For plain-text protocols, the model is useful here. It will recognize an HTTP exchange, an FTP login, an SMTP session or a simple beacon, and it can explain a header or a response code you have not seen before. Ask it to quote the evidence, then find each quote in the stream yourself.

Step 4: extract fields and ask for a judgment

Reading a stream does not scale to 400,000 packets. Pull one column out of the capture and ask a focused question about it. Here is every DNS query name with the time and source address:

bash
tshark -r capture.pcapng -Y "dns.flags.response == 0" -T fields -e frame.time_relative -e ip.src -e dns.qry.name > dns.tsv

Wireshark can also pull out other fields the same way, such as http.host, tls.handshake.extensions_server_name for the requested server name in a TLS handshake, or ip.dst with tcp.dstport. Do the counting with a script, not with the model, and give the model the result. This short Python script counts queries per domain and reports the longest first label:

python
import collectionsimport sys
counts = collections.Counter()longest = {}for line in open(sys.argv[1], encoding="utf-8"):    parts = line.rstrip("\n").split("\t")    if len(parts) < 3 or not parts[2]:        continue    name = parts[2].lower()    domain = ".".join(name.split(".")[-2:])    counts[domain] += 1    longest[domain] = max(longest.get(domain, ""), name.split(".")[0], key=len)
print("queries\tdomain\tlongest_first_label")for domain, n in counts.most_common(10):    print(f"{n}\t{domain}\t{len(longest[domain])}")

Run on the synthetic capture used for this article, it prints:

text
queries	domain	longest_first_label40	bad-dns.example	325	example.com	34	example.org	6

Paste that table and ask the model to judge it:

Here are DNS query counts per domain from one workstation, with the length of the longest first label. Which domains look normal and which look like possible DNS tunneling or beaconing, and why? List what I should check to confirm it, such as timing between queries and the character set of the labels.

The model should flag the 40 queries to bad-dns.example with 32-character random-looking labels, and ask you to check whether the intervals are regular. That is a hypothesis. A lookup against your threat intelligence, the query timing from the same dns.tsv and the domain's registration data confirm or kill it. Remember that a second-level domain taken as the last two labels is wrong for names like example.co.uk, so use a public suffix list for real work.

Where the model goes wrong

A model reading tshark text works only with the text. Check these before anything goes in a report:

  • Invented packet details. Ask what happened in packet 812 when you only pasted a summary and you may get a confident answer about flags, sequence numbers or payload bytes that were never in the input. If the number is not in what you pasted, it is a guess.
  • Miscounted statistics. Language models are unreliable at counting and summing rows. Compute totals, rates and top talkers with tshark -z, sort | uniq -c or Python, and give the model the result, as in step 4.
  • Encrypted traffic it cannot see. Most of a modern capture is TLS. The model can describe the handshake, the server name and the sizes and timing of the records, and it cannot tell you what was inside. Without keys, such as a SSLKEYLOGFILE from your own client, any claim about the content is a guess.
  • Wrong filter syntax. Capture filters (BPF, used with -f) and display filters (used with -Y or in the filter bar) are different languages, and models mix them. Field names also change between Wireshark versions. Test every filter, as in step 2.
  • Overconfident verdicts. "This is malware" or "this is normal" from a table of counts is an opinion. A backup job, a software updater and a beacon can all produce regular traffic to a single host. Corroborate with the process that made the connection, the host's logs and threat intelligence.
  • Reading lines out of context. A single stream or a trimmed table hides what came before and after. Tell the model what you cut.

The rule is the same as in malware analysis with Odin: the model drafts, you verify, and only verified findings go in the report.

Other network work

The same approach of pasting text, asking for structure and then verifying covers the rest of the investigation:

Common questions about AI for Wireshark

Can Odin open a pcap file?

No. Odin reads text only. Use tshark to print the summaries, stream text or fields you want to ask about, and paste that. Files that cannot be reduced to text, such as an encrypted payload, stay out of reach.

Can the model decrypt TLS traffic?

No. It reads the text you give it and cannot decrypt anything. If you control the client, a key log file lets Wireshark decrypt the session, and you can then follow the decrypted stream with tshark and paste the text.

Why do mainstream models refuse network analysis questions?

They react to how a prompt looks. Questions about beaconing, scans and exfiltration resemble attack planning even when you are the analyst who found them. Odin is built to answer legitimate security work directly.

Is it safe to paste a capture into a chat?

Only after you redact it. Remove credentials, cookies, personal data and real internal addresses, and follow the data rules in your engagement or employment terms. If you may not send the data to a third party at all, send the model only counts and shapes, such as protocol names, sizes and timing.

Which model should I use?

Use odin-v1 for reading unfamiliar traffic and writing filters, where its reasoning and 1,000,000-token context help. Use odin-flash, which is faster and cheaper, for quick questions such as "what does this TCP flag mean".

Get started

Create an API key in the console and follow the quickstart to make your first request, or paste a redacted tshark summary into the web chat to try it right away. Keep your work within the Acceptable Use Policy: analyze traffic to defend systems, and capture only what you are authorized to capture.

Comparing Odin with the assistant you use today? See uncensored AI for security research for a side-by-side comparison with mainstream assistants.