Writing Rolling PCAP Segments to Disk, Indexing Session Metadata in OpenSearch/Elasticsearch, Extracting Files & Hunting TLS/HTTP/SSH Fingerprints
Metadata logs alone tell you what happened, while raw packet captures (PCAP) prove exactly what traveled across the wire—including unencrypted payloads, custom protocol headers, TLS handshakes, and transferred files. Storing every raw packet in an index would explode storage costs, so Arkime (formerly Moloch) separates the problem into two tiers:
capture): Streams raw packet payloads into rolling `.pcap` files on fast block/NVMe storage, tracking exact file offset and byte length for each session so packets can be retrieved on demand.viewer web UI and REST API.Encrypted traffic hides payload text, but client and server handshake parameters still reveal valuable behavioral patterns. Modern network telemetry uses client/server fingerprints—such as JA4 / JA4+ (which extends TLS client fingerprinting with structured application/transport/QUIC/HTTP/SSH fingerprint variants), along with HTTP header/user-agent and SSH banner/algorithm metadata—to group sessions sharing similar client stacks even when domains or IPs rotate.
| Telemetry / Tuning Area | Operational Mechanism | Analyst / Architect Value |
|---|---|---|
| JA4+ & TLS Metadata | Captures TLS version, cipher suites, extensions, ALPN, SNI, certificate fields, and JA4+ fingerprint strings. | Spots unusual client stacks, custom tooling, or recurring TLS handshakes across shifting C2 endpoints. |
| Session Reconstruction | Reassembles TCP streams and HTTP/DNS/SMTP/SMB exchanges; links sessions to PCAP file offsets. | Lets analysts view ASCII/hex/HTTP/image/file views of exact sessions without digging through raw dumps manually. |
| Rolling PCAP Retention | Writes bounded PCAP files and deletes/ages oldest files based on disk free-space / retention limits. | Prevents packet capture disks from filling up and stalling `capture` ingestion. |
| Index Lifecycle (ILM/ISM) | Rolls daily/periodic session indices and ages cold/old session documents on a predictable schedule. | Keeps search queries fast and aligns index retention with PCAP storage windows. |
[default]
elasticsearch = http://127.0.0.1:9200
pcapDir = /data/arkime/pcap
maxFileSizeG = 12
maxFileTimeM = 1440
freeSpaceG = 10%
bpf = not port 22
yaraFile = /opt/arkime/etc/yara.rules
# Output from `/opt/arkime/bin/capture -c /opt/arkime/etc/config.ini --debug` startup check:
[INFO] Connected to OpenSearch/Elasticsearch cluster at http://127.0.0.1:9200 (status: green)
[INFO] PCAP directory /data/arkime/pcap verified (maxFileSizeG=12, freeSpaceG=10%)
[INFO] Compiled BPF filter: "not port 22" | Loaded YARA ruleset: /opt/arkime/etc/yara.rules
ip.src == 10.10.20.0/24 && !ip.dst == 10.0.0.0/8 && bytes.src > 10000000
Matched Sessions: 2
1) 2026-11-26 09:14:22 | 10.10.20.41:52110 -> 198.51.100.120:443 | proto: tcp/tls | bytes.src: 24,812,900 | bytes.dst: 19,402
2) 2026-11-26 08:47:05 | 10.10.20.18:49802 -> 203.0.113.99:80 | proto: tcp/http | bytes.src: 14,820,400 | bytes.dst: 245
protocols == http && http.method == POST && (http.useragent == *curl* || http.useragent == *python* || http.uri == */upload*)
Matched Sessions: 3
1) 10.10.30.12 -> 203.0.113.99:80 | POST upload-sync.example/api/v1/upload | Status: 200 | UA: python-requests/2.31.0
2) 10.10.19.08 -> 198.51.100.44:8080 | POST drop.example/upload | Status: 201 | UA: curl/8.5.0
protocols == tls && (cert.subject.cn == *temp* || tls.ja4 == *t13d1516h2_*)
Matched Sessions: 4
1) 10.10.24.55 -> 198.51.100.72:443 | SNI: cdn-sync-check.example | Cert CN: CN=temp-node-01 | JA4: t13d1516h2_8daaf6152771_e5627efa2ab1
protocols == dns && dns.query == /^[a-z0-9]{30,}\./
Matched Sessions: 18
1) 10.10.15.88:54912 -> 10.10.0.53:53 | QName: 7f8a9c2e4b6d1035a8c7e9b1d3f5a7c9.sub.tunnel-test.example | Type: TXT | Status: NOERROR
/opt/arkime/bin/capture -c /opt/arkime/etc/config.ini \
-r /tmp/incident_capture.pcap \
--tag "IR-Case-2026-114"
Processing /tmp/incident_capture.pcap
Final cleanup
Total Packets: 48,920 | Sessions Indexed: 612 | Tag Applied: IR-Case-2026-114
tcpdump -r /data/arkime/pcap/sensor01-261125-000001.pcap \
-w /tmp/suspect_10_10_24_55.pcap \
'host 10.10.24.55 and port 443'
reading from file /data/arkime/pcap/sensor01-261125-000001.pcap, link-type EN10MB (Ethernet), snapshot length 262144
# Wrote 318 matching packets to /tmp/suspect_10_10_24_55.pcap (244 KB)
tshark -r /tmp/suspect_10_10_24_55.pcap \
-q -z follow,tcp,ascii,0
===================================================================
Follow: tcp,ascii
Filter: tcp.stream eq 0
Node 0: 10.10.24.55:51422
Node 1: 203.0.113.99:80
184
POST /api/v1/upload HTTP/1.1
Host: upload-sync.example
User-Agent: python-requests/2.31.0
Content-Length: 42
{"host":"app-node-04","status":"ready"}
===================================================================
rule Suspicious_Cleartext_Auth_Header {
strings:
$a = "Authorization: Basic " ascii nocase
$b = "password=" ascii nocase
condition:
any of them
}
[ARKIME SESSION TAGGER]
Matched YARA Rule : Suspicious_Cleartext_Auth_Header
Applied Tag : yara:Suspicious_Cleartext_Auth_Header
Session : 10.10.14.22:50318 -> 10.10.50.12:8080 (HTTP cleartextBasic Auth observed)
import requests
ARKIME_URL = "http://127.0.0.1:8005"
params = {
"expression": "ip.src == 10.10.24.55 && bytes.src > 100000",
"length": 25
}
resp = requests.get(f"{ARKIME_URL}/api/sessions", params=params, verify=False)
data = resp.json()
print("Matched sessions:", data.get("recordsFiltered"))
for s in data.get("data", []):
print(s.get("id"), s.get("srcIp"), "->", s.get("dstIp"), "bytes.src:", s.get("srcBytes"))
Matched sessions: 2
261126-V8k2mN9pQrStUvWxYz1234 10.10.24.55 -> 198.51.100.72 bytes.src: 482190
261126-K3m9pL2wQxRtYuIoPa5678 10.10.24.55 -> 203.0.113.99 bytes.src: 14820400
Select a network investigation scenario below to see the Arkime search filter, session metadata summary, and packet-level follow-up: