🕵️ Wireshark Local RAG Analyst
A fully local, self-learning Retrieval-Augmented Generation (RAG) pipeline for analyzing Wireshark .pcap logs using local LLMs — with built-in support for Hugging Face models, learning feedback, and REST API access.
🚀 Features
- 📁 Drop-in Folder Watcher: Automatically processes
.pcaplogs when dropped into a folder. - 🔍 Protocol-Aware Preprocessing: Extracts HTTP, DNS, TCP, and other traffic.
- 🧠 Self-Learning Engine: Remembers helpful answers and improves responses over time.
- 📚 RAG Pipeline: Uses local vector database (FAISS) with sentence-transformer embeddings.
- 🤖 Local LLM Integration: Supports both:
- 🧱 Ollama-based LLMs (e.g., LLaMA, Mistral, GPT4All)
- 🤗 Hugging Face models (e.g., Mistral-7B, Zephyr, Falcon)
- 🌐 API Access (MCP-style): Query the system over HTTP from other clients.
- 💻 Extensible CLI: Flexible CLI and script interface for querying and development.
- 📦 PyPI-Ready: Fully packageable and publishable as a pip package.
- ✅ CI/CD Support: GitHub Actions pipelines for testing and PyPI publishing.
📂 Project Structure
.
├── app/ # Core logic
├── scripts/ # CLI scripts
├── config/ # Config files
├── data/ # Vector DB & learned responses
├── logs/ # Input PCAPs
├── processed/ # Archived PCAPs
├── .github/workflows/ # CI/CD workflows
⚙️ Installation
- Clone the repo
git clone https://github.com/pkbythebay29/wireshark-local-rag-analyst.git
cd wireshark-local-rag-analyst
- Install Dependencies
pip install -r requirements.txt
- Configuration
Edit config/config.yaml:
protocol_filter: ["http", "dns"]
learning: true
llm_backend: "ollama" # or "huggingface"
llm_model: "llama3" # or "mistralai/Mistral-7B-Instruct-v0.1"
vector_db_path: "./data/faiss.index"
learned_store: "./data/learned_data.jsonl"
- Usage
wireshark-watch
or
python scripts/run_pipeline.py
Drop .pcap files into the logs/ folder — they will be processed automatically.
#5. Ask questions
wireshark-query
or
python scripts/query_logs.py
Example questions:
- What HTTP requests failed with 404?
- Show DNS queries to suspicious domains.
- Were there any TCP handshakes that failed?
- Use as a REST API (MCP server)
python -m app.mcp_server
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"query": "Show me failed DNS requests"}'
- 🤗 Hugging Face Model Support
You can fork, fine-tune, or use any Hugging Face model by editing config.yaml
- Acknowledgements
🙏 Acknowledgements
This project stands on the shoulders of open-source giants:
Wireshark/tshark – For deep packet inspection
FAISS – Vector search from Meta
Sentence Transformers – Fast embeddings from Hugging Face
Ollama – Local model hosting made easy
Transformers – Hugging Face's interface to modern LLMs
Watchdog, FastAPI, Uvicorn, and many more
Thank you to all the contributors making open-source incredible.
- 🗺️ Roadmap
See ROADMAP.md for planned features and timeline.
#8. License 📜 License MIT
Metadata
Release files for wireshark-rag-analyst 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| wireshark_rag_analyst-0.1.0.tar.gz | 8.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wireshark_rag_analyst-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / wireshark_rag_analyst-0.1.0.tar.gz
| Download URL | wireshark_rag_analyst-0.1.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
607dba8d902b94840d6c4494676c02ca3bd781c90a620f4376d6575adfd6e872
|
|
BLAKE2b-256 checksum How to use checksums |
806daca48f7caf9b228adb48207f798deae6ab7abf9151db8aaa6237bb2769f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Release files / wireshark_rag_analyst-0.1.0-py3-none-any.whl
| Download URL | wireshark_rag_analyst-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc20bcdf8b69ef4c4afaaa242542985c07d92a0cc7df797f7bb8b03f6c7b7342
|
|
BLAKE2b-256 checksum How to use checksums |
458d9359de0ad3806f50e1464f8fcd0615a852f991594f91188d13ef18deeb6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Security for wireshark-rag-analyst 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.