/secskills-defense:analyzing-network-trafficfrom secskills-defense
Analyzes packet captures and network telemetry for intrusion evidence including C2 beacon confirmation, DNS-tunnel detection, TLS/JA3 fingerprinting, and exfiltration hunting. Use when a pcap needs forensic review or a Zeek/Suricata alert requires follow-up.
Ships in secskills-defense. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Packet capture is ground truth the endpoint can lie about but the wire cannot: every connection, DNS lookup, and byte transferred is recorded, whether or not the host's logs survived. The analysis is turning a flat capture into a story — who talked to whom, over what protocol, whether the pattern was human or automated, and what left the network. You are reconstructing intent from frames, not reading a verdict off a tool.
.pcap / .pcapng capture needs forensic review for intrusion evidencenotice.log or Suricata eve.json alert needs to be run down to a verdicthunting-threats; this skill dissects one
capture, a hunt spans data sourcesresponding-to-incidents; traffic
analysis is one evidence stream feeding that processanalyzing-malware;
come here to analyze the pcap it emitted, not to run the binaryinvestigating-aws-incidentstesting-web-applicationsGet the capture right or every later step inherits the gap. A truncated snaplen or a dropped-packet capture cannot be fixed after the fact.
# Full-frame capture, no name resolution, write to disk (never parse live)
tcpdump -i eth0 -nn -s 0 -w case.pcap
# -s 0 takes full frames; a default snaplen truncates payloads and breaks carving
# Ring buffer for long-running capture: 20 files of 200 MB, oldest recycled
tcpdump -i eth0 -nn -s 0 -w case-%Y%m%d-%H%M%S.pcap -G 3600 -C 200 -W 20
# Capture without dropping under load: raise the kernel buffer, filter tightly
tcpdump -i eth0 -nn -s 0 -B 4096 'not port 22' -w case.pcap
# Confirm drops after: the summary line reports "packets dropped by kernel"
Check whether the capture is intact and what you are holding:
capinfos case.pcap # packet count, duration, drop stats, snaplen, file type
tshark -r case.pcap -q -z io,phs # protocol hierarchy — is the snaplen truncating?
.pcap is a flat single-link format. editcap -F libpcap in.pcapng out.pcap downgrades for a tool that only reads pcap.editcap -c 1000000 big.pcap chunk.pcap (per packet count) or
editcap -i 600 big.pcap chunk.pcap (per 600 seconds).mergecap -w all.pcap a.pcap b.pcap (sorts by timestamp).editcap -A "2026-07-26 00:00:00" -B "2026-07-26 06:00:00" case.pcap window.pcap.tcprewrite/bittwiste to rewrite
addresses, or editcap -s <snaplen> to truncate each packet to the first
snaplen bytes (keeping headers, dropping trailing payload); TraceWrangler
for deeper header/payload sanitization. Record what you changed so the
recipient does not chase your rewrite as an artifact.Hash the original and work on copies. sha256sum case.pcap goes in the case
notes; the evidence file is read-only from here on.
Start wide, narrow to the flows that matter. In Wireshark, work top-down:
Everything Wireshark does interactively, tshark does scriptably — which is how
you extract fields across a whole capture instead of clicking:
# Top talkers by bytes
tshark -r case.pcap -q -z conv,tcp
# Extract just the fields you want, tab-separated, for further processing
tshark -r case.pcap -T fields -E separator=/t \
-e frame.time_epoch -e ip.src -e ip.dst -e tcp.dstport -e frame.len \
-Y 'tcp.flags.syn==1 && tcp.flags.ack==0' # every connection attempt
# Every HTTP request: host, method, URI, user-agent
tshark -r case.pcap -T fields -e http.host -e http.request.method \
-e http.request.uri -e http.user_agent -Y http.request
Display filters are the scalpel. The highest-value ones:
| Filter | Surfaces |
|---|---|
http.request | Every outbound HTTP request — URIs, hosts, user agents |
dns | All DNS; add dns.flags.rcode == 3 for NXDOMAIN (DGA tell) |
tls.handshake.type == 1 | ClientHello only — SNI, JA3 input, offered ciphers |
tls.handshake.type == 2 | ServerHello — chosen cipher, JA3S input |
ip.addr == 10.0.0.5 | All traffic to or from a host (src/dst to pin direction) |
tcp.flags.syn==1 && tcp.flags.ack==0 | Connection attempts — scan and beacon cadence |
tcp.flags.reset==1 | RSTs — refused/closed, port-scan responses |
frame contains "password" | Byte-string search across payloads (cleartext creds, markers) |
tcp.stream eq 7 | Isolate one reassembled conversation by stream index |
tcp.analysis.retransmission | Loss/instability that skews timing analysis |
http.response.code == 200 && http.content_type contains "octet-stream" | File transfers over HTTP |
Chain them: ip.dst == 185.100.87.0/24 && dns scopes DNS to one suspect
netblock. dns.qry.name matches "[a-f0-9]{20,}" flags long hex labels.
Zeek turns a pcap into structured, queryable logs — the single highest-leverage move on any capture bigger than a few thousand packets.
zeek -r case.pcap
# Or add the community-id field for cross-tool pivoting:
zeek -r case.pcap policy/protocols/conn/community-id-logging
ls # conn.log dns.log http.log ssl.log x509.log files.log notice.log weird.log ...
The log set and what each answers:
| Log | Answers |
|---|---|
conn.log | Every flow: duration, orig/resp bytes, state, service — the backbone of beacon and exfil analysis |
dns.log | Every query/response — tunneling, DGA, TXT/NULL abuse |
http.log | Host, URI, method, user-agent, status, referrer |
ssl.log | TLS version, SNI, JA3/JA3S, cert chain, validation status |
x509.log | Certificate subject, issuer, validity, self-signed flag |
files.log | Every file seen on the wire — MIME, size, MD5/SHA1, source flow |
notice.log | Zeek's own detections (SSL::Invalid_Server_Cert, scans, etc.) |
weird.log | Protocol violations — protocol-on-wrong-port, malformed frames |
Mine them with zeek-cut (field extraction by name, order-independent):
# Longest connections first — beacons and tunnels live at the top
cat conn.log | zeek-cut id.orig_h id.resp_h duration orig_bytes resp_bytes \
| sort -t$'\t' -k3 -rn | head
# Every distinct destination one host reached, with hit counts
cat conn.log | zeek-cut id.orig_h id.resp_h | grep '^10\.0\.0\.5' \
| sort | uniq -c | sort -rn
# DNS query names + types, to eyeball tunneling and DGA
cat dns.log | zeek-cut query qtype_name answers | sort | uniq -c | sort -rn | head -50
# Pivot a suspicious flow across all logs by its community-id
cat conn.log | zeek-cut community_id id.orig_h id.resp_h service
The community-id field is the same string across Zeek, Suricata, and many
EDRs for the same flow — use it to line up an alert with the packets.
Run signatures offline against the capture to see what a rule set flags:
# Run ET Open / community rules over the pcap, write structured events
suricata -r case.pcap -S /etc/suricata/rules/suricata.rules -l ./out/
# eve.json holds alerts, plus dns/http/tls/flow records if enabled
Extract and rank the alerts:
jq -c 'select(.event_type=="alert") | {sig:.alert.signature, src:.src_ip, dst:.dest_ip}' \
out/eve.json | sort | uniq -c | sort -rn
Read alerts as leads, not verdicts. A signature hit tells you where to look; it does not close the case, and its absence does not clear the capture.
Automated callbacks betray themselves in the timing and the shape, not the
content. Look in conn.log for a source/destination pair that recurs at a
regular interval, with small and roughly constant request sizes, over a long
span. Human traffic is bursty and varied; a beacon is a metronome.
# Inter-arrival deltas for one src/dst pair — near-constant gaps = beacon
tshark -r case.pcap -T fields -e frame.time_epoch \
-Y 'ip.src==10.0.0.5 && ip.dst==185.100.87.202' \
| awk 'NR>1{print $1-prev} {prev=$1}' | sort -n | uniq -c
Automate the scoring with RITA or a beacon-analysis tool over Zeek logs —
they compute interval and size consistency across every pair so you are not
eyeballing one at a time:
rita import --database case --logs ./ && rita view case beacon:'>=90'
DNS is the covert channel of choice because it is rarely blocked and often
unlogged. In dns.log, two distinct patterns:
Tunneling — DNS used as a data pipe:
MFRGG43FMQ.tunnel.evil.com, base32/hex-looking subdomainsTXT and NULL record types carrying encoded payload upstream/downstream# Subdomain cardinality per parent domain — a tunnel spikes on one domain
cat dns.log | zeek-cut query | rev | cut -d. -f1-2 | rev \
| sort | uniq -c | sort -rn | head
# TXT queries only — legitimate use is sparse; volume is a flag
cat dns.log | zeek-cut query qtype_name | awk -F'\t' '$2=="TXT"' | wc -l
DGA — algorithmically generated rendezvous domains:
NXDOMAIN rate (rcode 3) as the malware cycles through dead namescat dns.log | zeek-cut rcode_name query | awk -F'\t' '$1=="NXDOMAIN"' \
| wc -l # a burst of NXDOMAIN from one host is a DGA tell
Score label entropy or use a DGA classifier to separate cdn-3f2a.example
(benign hash) from qwzjxkbvmn.info (generated). Volume plus entropy plus
NXDOMAIN together make the case; any one alone has benign explanations.
You cannot read the plaintext without keys, but the handshake still fingerprints the client, the server, and the intent. Encryption hides content, not metadata.
ssl.log carries ja3/ja3s; correlate against public and internal
known-bad lists.ssl.log / x509.log look for: self-signed certs, SNI that does not
match the certificate CN/SAN, absurd validity windows (1000-year or
same-day certs), empty/garbage subject fields, and SNI pointing at
suspicious or newly-registered domains.# Self-signed or validation-failed TLS, with the SNI and JA3
cat ssl.log | zeek-cut server_name validation_status ja3 ja3s \
| grep -iv '\bok$' | sort | uniq -c | sort -rn
# SNI vs certificate subject mismatch — join ssl.log and x509.log on cert id
cat x509.log | zeek-cut certificate.subject certificate.issuer \
certificate.not_valid_before certificate.not_valid_after
When you legitimately hold the session keys (a lab detonation with
SSLKEYLOGFILE set, or an exported master secret), decrypt in Wireshark:
Preferences > Protocols > TLS > (Pre)-Master-Secret log filename, or
tshark -r case.pcap -o tls.keylog_file:keys.log -Y http2. Never assume you can
decrypt production TLS you have no keys for — you are fingerprinting, not
reading.
Cleartext HTTP (and decrypted TLS) exposes the whole exchange:
python-requests, an empty UA, a typo'd browser string) on outbound traffic
is a common malware tell. Stack UAs and investigate the rare ones.http.log — base64-looking paths, long random query
strings, .php endpoints on a raw IP, or POSTs of opaque blobs.Carve transferred files and hash them for pivoting:
# Zeek extracts files automatically when configured; otherwise from files.log:
cat files.log | zeek-cut fuid mime_type filename md5 sha1 tx_hosts rx_hosts
# Carve without Zeek:
foremost -i case.pcap -o carved/ # signature-based file recovery
tcpflow -r case.pcap -o flows/ # reassemble every TCP stream to a file
# NetworkMiner (GUI/CLI) reassembles files, images, and credentials from a pcap
Hash every carved artifact and pivot suspicious ones to analyzing-malware:
sha256sum carved/* — a file that appeared on the wire and matches nothing
benign is the next sample to detonate.
Data leaving is the outcome that matters most. In conn.log, sort by
orig_bytes descending — large outbound flows are the headline, and the
direction (orig = the internal host sending) is the whole point.
# Biggest outbound transfers from internal hosts
cat conn.log | zeek-cut id.orig_h id.resp_h resp_p orig_bytes duration \
| awk -F'\t' '$4>10000000' | sort -t$'\t' -k4 -rn
*.s3.amazonaws.com,
*.blob.core.windows.net), paste sites (pastebin, ghostbin), and
file-share domains as the destination of a large upload from a server that
has no business reason to use them.Attackers hide traffic on the wrong port and in the wrong protocol:
conn.log's service field is Zeek's detected protocol,
independent of port number.conn.log (service disagrees with id.resp_p) and in weird.log.# Detected service does not match the port — tunneling / evasion
cat conn.log | zeek-cut id.resp_p service | awk -F'\t' \
'($1=="443" && $2!="ssl") || ($1=="53" && $2!="dns")' | sort | uniq -c
frame contains "PASS " in Wireshark, or NetworkMiner's credentials
tab, pulls them straight out.The capture's value is what you extract for reuse. Tier indicators the way you would from any source — behaviour outlives infrastructure — and route each output:
.yar in writing-yara-rules
against structure, not the URI it happened to use.producing-threat-intelligence.writing-sigma-rules
for log-based rules and engineering-detections for the broader rule
pipeline (a Suricata signature for the JA3, a Zeek notice for the beacon
cadence, a Sigma rule for the DNS pattern).reporting-security-findings.Record for every indicator: the flow it came from, the timestamp, and your confidence. An IP with no context is noise to whoever receives it.
Generated from secskills-core/ttp-index.json — edit that file, then run
python3 scripts/sync_attack.py --write. Re-verify IDs against the
current ATT&CK release before citing them in a report.
Command and Control (TA0011)
analyzing-malware, engineering-detectionsengineering-detections, hunting-threatstransferring-files, analyzing-malwareanalyzing-malware, hunting-threatsanalyzing-malware, engineering-detectionsExfiltration (TA0010)
transferring-files, hunting-threatsDetection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.
hunting-threats — proactive, hypothesis-driven search across many telemetry
sources, of which network data is oneresponding-to-incidents — the incident process this evidence stream feedsanalyzing-malware — detonate the sample to produce traffic, and receive
carved files from this skill for analysisinvestigating-aws-incidents — when the evidence is cloud control-plane logs
rather than packetswriting-yara-rules — file signatures from carved artifactsproducing-threat-intelligence — packaging extracted IOCs into a productreporting-security-findings — the stakeholder write-uptshark and capinfos — interactive and scripted dissectionzeek-cut and community-id — structured logs from any capturetcpdump — capture; editcap / mergecap — split, merge, trim, and convertWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub trilwu/secskills --plugin secskills-defense22 skills in this plugin
/analyzing-disk-imagesPerform dead-disk forensics on an acquired disk image using The Sleuth Kit, Plaso, and bulk_extractor — verify integrity and mount read-only, map partitions, recover deleted files, build a file-system and super-timeline, carve unallocated space, mine registry hives and OS artifacts, and detect anti-forensics. Use when handed a .E01/.dd/.raw/.vmdk/.vhdx disk image or forensic acquisition to examine, recovering deleted files, building a file-system timeline, or carving artifacts from unallocated space./analyzing-linux-persistenceSystematically identify and analyze persistence mechanisms on Linux systems during DFIR investigations -- sweep systemd units, cron jobs, shell initialization, SSH config, kernel modules, LD_PRELOAD, package manager hooks, udev rules, container entrypoints, and XDG autostart entries. Use when investigating a compromised Linux host, performing forensic analysis of a Linux disk image, looking for backdoors or unauthorized access mechanisms, or determining how an attacker maintained access./analyzing-malwareAnalyze suspected malware safely — containment, static triage, sandboxed detonation, unpacking, capability and C2 extraction, IOC production, and YARA rule authoring. Use when handed a suspicious file, hash, or sample, when triaging an alert artifact, or when producing detection content from a specimen.2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job