Skip to content
NotYuShengPublic

About

Open-source, self-hosted PCAP analyzer for network forensics: device discovery, network maps, Suricata and nDPI threat detection, change monitoring, and local-LLM incident stories. Runs fully offline.

Topics

Resources

Contributing

Stars

58 stars

Watchers

1 watching

Forks

Latest commit

 

History

1,130 Commits

Folders and files

Repository files navigation

TracePcap

Open-source, self-hosted PCAP analyzer for network forensics: reconstruct the devices, topology, sessions and threats of a network from packet captures alone.

Quick start • Features • See it in action • How it works • Documentation

Spring Boot React PostgreSQL Docker MinIO Java 21


TracePcap is for when all you have is the traffic: no documentation, no asset list, no prior knowledge of the network. Upload packet captures (PCAP or PCAPNG) and it works out which devices are there, what each one is, who talked to whom, and what looks wrong, using tshark, nDPI and Suricata underneath. It can also track how a network changes between captures, and an LLM can write up what happened. Everything runs on your own machine, fully offline.

Use it for:

  • Network audits and third-party assessments: handed a capture and nothing else, build the picture from scratch.
  • Incident response and forensics: reconstruct what happened from packet evidence when records are incomplete.
  • Penetration-test reconnaissance: map an unknown network from captured traffic.
  • Research and teaching: explore any capture without context about where it came from.

Quick start

You need Docker with Docker Compose, on amd64 or arm64 (including Apple Silicon), and at least 8 GB of RAM (6 GB with Suricata off).

git clone https://github.com/NotYuSheng/TracePcap.git
cd TracePcap
cp .env.example .env
docker compose up -d

Open http://localhost and drop in a capture (.pcap, .pcapng or .cap, up to 327 MB by default). The first start takes a minute while the database and storage initialise.

Next steps

  • Turn on the AI features (story, chat, insights): point LLM_API_BASE_URL in .env at a local or LAN OpenAI-compatible server such as LM Studio or Ollama, never a public API. Everything else works without one. See LLM setup.
  • Turn on login (Keycloak, with Viewer, Analyst, Lead and Admin roles) before more than one person uses it. See Authentication.
  • Air-gapped machine? See Offline deployment.
  • Kubernetes? There's a Helm chart, tracepcap-helm: helm install tracepcap oci://ghcr.io/notyusheng/charts/tracepcap. See Kubernetes (Helm).
Hardware sizing
Minimum Recommended Comfortable
RAM 6 GB (SURICATA_ENABLED=false) 8 GB+ 16 GB
CPU 4 cores 4+ cores 8 cores
Storage 10 GB 50 GB+ 100 GB+ SSD

This sizes the TracePcap stack only; a self-hosted LLM needs its own. The containers' limits total about 4.4 GB (5.4 GB with login on). The upload limit follows APP_MEMORY_MB: about 16% of it, so 327 MB at the default 2048. See Container resource limits and Supported CPU architectures.

Features

Every item links to its page in the documentation.

Discover: build an inventory from nothing

Inspect: see exactly what crossed the wire

Detect: surface threats and anomalies

  • Suricata IDS alerts and nDPI application, risk and TLS (JA3, SNI, certificate) analysis on every conversation.
  • Detection rules of your own, by address, port, JA3, hostname, app or payload pattern, for one capture, one network or everything.

Narrate: plain language, from a local LLM (optional)

  • Story: who was attacked, who was signed in, what malware ran and where it called home, each answer with its evidence, then the whole story in order.
  • Ask about a capture: a chat that looks things up before answering and writes checked Wireshark filters.

Monitor: follow a network across captures

  • Network monitor: add captures of the same network over time; each is compared with the one before (new devices, ARP and MAC drift, gateway, protocol and VPN changes), ranked by severity.

Around all of it: a PDF report, re-analysing with other options, roles and permissions with an audit log, and one Settings page.

See it in action

Two minutes through the main features: upload, the Overview, the flagged conversations, the network map and one host's card, the story's four answers, the chat writing a filter for the C2 traffic, the report, and a monitored network changing over eight weeks.

TracePcap feature tour: uploading a capture, the Overview, flagged conversations, the network map, the story's four answers, the chat writing a Wireshark filter, the PDF report, and a monitored network over eight weeks

Click the GIF for the full-quality video on YouTube, with chapters and captions.

The capture is a real incident: a STRRAT remote-access trojan on a corporate LAN, from malware-traffic-analysis.net's training exercises. Worked investigations, step by step:

How it works

docker compose runs nginx (serving the React web app), a Spring Boot backend, PostgreSQL and MinIO, plus Keycloak when login is on. The backend's image bundles tshark, nDPI 6, Suricata and mergecap, and runs them on each capture.

TracePcap containers

  • Nothing leaves your machine. Captures are stored and analysed locally. Geolocation comes from a bundled DB-IP database (online lookups are off unless you opt in with GEO_FORCE_OFFLINE=false), and the LLM, if you use one, must be local or on your LAN. It's sent findings, not raw packets.
  • Login is optional. The base stack runs open, for one person. With login on, Keycloak decides who may sign in and which role they have; TracePcap decides what each role may do.

More in System architecture and the five-stage pipeline.

Security

  • Turn on login before sharing it. The base stack has no authentication; anyone who can reach it can use it. See Authentication, and change every default credential in .env for a real deployment.
  • Roles limit what each person may do (upload, ask the AI, export packets, delete others' captures, change settings), and changes are recorded in an audit log. Everyone who can sign in can see every capture.
  • PostgreSQL (5432) and the MinIO console (9001) are published on the host by every stack. Firewall them, or remove those ports, on any machine others can reach; see Production hardening.

Documentation

Everything is at https://notyusheng.github.io/TracePcap:

The REST API is described at /swagger-ui/index.html on a running instance (off in the production overlay), and in openapi/baseline.json.

Sample captures

sample-files/ has captures to try, most with the gen_*.py script that made them:

  • office_showcase.pcap: a small office (four VLANs) plus the cases the network map shows best, good for a first look
  • demo_all_rules.pcap: triggers every rule in signatures.sample.yml
  • dhcp_address_reuse.pcap, device_roaming.pcap, site_to_site_vpn.pcap: the device-identity cases from the docs' worked investigations
  • monitor_large/: eight weekly captures of a simulated 550-device network, for the network monitor
  • free5gc.pcap (5G core traffic), and protocol samples: ftp.pcap, signal.pcap, discord.pcap

Contributing

See CONTRIBUTING.md. Branch from dev and open pull requests against dev.

Star history

Star History Chart

License

MIT. See LICENSE.

About

Open-source, self-hosted PCAP analyzer for network forensics: device discovery, network maps, Suricata and nDPI threat detection, change monitoring, and local-LLM incident stories. Runs fully offline.

Topics

Resources

Contributing

Stars

58 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages