Table of Contents
This tool is intended strictly for educational purposes, forensic analysis, and defensive security assessments. Z-Shark provides deep insight into network traffic patterns using advanced statistical models. The author (
Delta-Security) is not responsible for any misuse of this tool on unauthorized networks. By using this software, you agree to do so in compliance with all applicable laws.
Z-Shark is not a traditional IDS that relies on static signatures. Instead, it is a Mathematical Network Forensics Platform designed to detect anomalies that evade standard rule-based systems. It leverages Signal Processing (FFT), Information Theory (Entropy), and Statistical Profiling (Z-Scores) to identify subtle threat patterns.
- Streaming Architecture: Z-Shark slices PCAP streams into time-based chunks, allowing it to analyze massive capture files without exhausting memory.
- Explainable AI (XAI): Every detection includes a mathematically rigorous
justificationandevidencepayload, ensuring analysts understand why an alert was triggered. - Global CLI: Once installed via the Debian package,
zsharkbecomes a native system command accessible from any directory.
Z-Shark includes a suite of specialized detection models:
- Mechanism: Tracks the Inter-Arrival Times (IAT) of packets and applies Fast Fourier Transform (FFT).
- Math Used:
numpy.fft.fftcalculates the magnitude spectrum. - Trigger: A significant peak in the frequency spectrum indicates automated communication typical of malware beacons.
- Math Used: * Z-Score: Measures standard deviations from the historical mean to catch volume spikes.
- Shannon Entropy: Monitors Source IP randomness; a sudden drop suggests a concentrated flood.
- Mechanism: Analyzes lexical properties of queried domain names.
- Math Used: Shannon Entropy applied to character distribution to detect Domain Generation Algorithms.
| Component | Responsibility |
|---|---|
| Packet Streamer | Lazy-loading of PCAP files to minimize RAM usage. |
| Window Processor | Slices the packet stream into time windows for temporal analysis. |
| Analysis Engine | Applies loaded models to each window. |
| Reporting Engine | Renders professional PDF forensics reports from JSON data. |
graph LR
A[Input PCAP] -->|Stream| B(PacketStreamer)
B -->|Raw Packets| C{WindowProcessor}
C -->|"Time Window"| D[Analyzer Engine]
subgraph Models
D --> E[FFT Beaconing]
D --> F[Z-Score DDoS]
D --> G[Entropy DNS]
D --> H[Stateful ARP]
end
E & F & G & H -->|Detections| I[Aggregator]
I -->|JSON Export| J[analysis.json]
J -->|Render| K[PDF Forensic Report]
The easiest way to install Z-Shark on Kali Linux or any Debian-based system:
sudo apt update
sudo apt install ./zshark_2.1.1_all.debIf you want to run it from source or contribute to the project:
- Clone the Repository:
git clone [https://github.com/Delta-Security/z-shark.git](https://github.com/Delta-Security/z-shark.git)
cd z-shark- Install Dependencies: Z-Shark relies on heavy scientific computing libraries (
numpy,scipy,pandas).
python -m venv .venv
source .venv/bin/activate # Linux/macOS
pip install -r requirements.txtZ-Shark is driven by a powerful Typer-based CLI (zshark/cli/main.py).
- Analyze a PCAP File Run the full suite of mathematical models on a capture file.
zshark analyze capture.pcap -o results/ -v
python -m zshark.cli.main analyze capture.pcap --out-dir results/ #(Development Mode)- Output: Generates a raw
analysis.jsoncontaining all window stats and detection evidence.
- Generate Forensic Report
Convert the JSON analysis into a human-readable PDF.
zshark report results/analysis.json -o Forensic_Report.pdf
python -m zshark.cli.main report results/capture_analysis.json --pdf-path report.pdf #(Development Mode)- Output: A professional PDF report with charts, evidence tables, and justifications.
- Quick Statistical Summary
(Placeholder/Beta) Get a quick overview of top talkers and protocols.
zshark summary results/analysis.json --top 10
python -m zshark.cli.main summary capture.pcap --top 10 #(Development Mode)This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Delta-Sec | Mathematics meets Cybersecurity GitHub: github.com/Delta-Sec