Skip to content

Failureguy94/WireShark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦈 Mini WireShark - Network Packet Analyzer

License: MIT C++ React TypeScript

A lightweight, real-time network packet analyzer with modern web interface

Capture, analyze, and visualize network traffic with ease


πŸ“Έ Application Preview

Mini WireShark Dashboard

Real-time packet capture showing live network traffic analysis with protocol statistics


🎯 Why This Project?

The Problem

Network analysis is crucial for:

  • Security Professionals: Detecting malicious traffic, intrusions, and vulnerabilities
  • Developers: Debugging network-related issues in applications
  • System Administrators: Monitoring network health and performance
  • Students: Learning about network protocols and packet structures

However, tools like Wireshark can be overwhelming for beginners and resource-heavy for simple tasks.

The Solution

Mini WireShark provides:

  • βœ… Simplified Interface: Clean, intuitive web UI without the complexity
  • βœ… Real-time Monitoring: Live packet capture with instant visualization
  • βœ… Cross-Platform Access: Access from any browser on your network
  • βœ… Modern Stack: High-performance C++ backend with reactive frontend
  • βœ… Educational Value: Clear protocol breakdown for learning purposes

✨ Features

Backend (C++ with libpcap)

Feature Description
πŸ”΄ Live Capture Real-time packet capturing using libpcap
πŸ” Protocol Decoding Ethernet, IPv4, TCP, UDP, ICMP support
πŸ“Š Traffic Analysis Automatic statistics and pattern detection
🌐 REST API HTTP server exposing packet data as JSON
πŸ“ Logging Comprehensive logging for debugging

Frontend (React/TypeScript)

Feature Description
πŸ“± Responsive Design Modern UI built with Tailwind CSS
⚑ Real-time Updates Live packet stream with auto-refresh
🎨 Protocol Highlighting Color-coded protocols for easy identification
πŸ“ˆ Statistics Dashboard Charts showing protocol distribution
πŸ”Ž Filtering Filter packets by protocol, IP, or content
πŸ’Ύ Export Download captured packets as JSON

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         User Browser                            β”‚
β”‚                    http://localhost:3000                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ HTTP/JSON
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     React Frontend                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Dashboard β”‚  β”‚PacketList β”‚  β”‚Statistics β”‚  β”‚  Details  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ REST API (Port 8080)
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    C++ Backend Server                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚HTTP Serverβ”‚  β”‚ Analyzer  β”‚  β”‚  Decoder  β”‚  β”‚  Capture  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚ libpcap
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Network Interface                            β”‚
β”‚                  (eth0, wlan0, etc.)                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Manual Setup

Prerequisites

  • C++ Compiler: GCC 7+ or Clang 5+
  • CMake: 3.10+
  • libpcap: Development headers
  • Node.js: 16+

πŸš€ Quick Start

Prerequisites

Requirement Version Purpose
C++ Compiler GCC 7+ / Clang 5+ Backend compilation
CMake 3.10+ Build system
libpcap Latest Packet capture
Node.js 16+ Frontend runtime
npm 7+ Package management

Installation

1. Install System Dependencies

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y cmake build-essential pkg-config libpcap-dev nodejs npm

macOS:

brew install cmake libpcap node

Arch Linux:

sudo pacman -S cmake base-devel libpcap nodejs npm

2. Build the Backend

cd WireShark/cpp-packet-analyzer
mkdir -p build && cd build
cmake ..
make -j$(nproc)

3. Setup the Frontend

cd frontend
npm install

▢️ Running the Application

Step 1: Start Backend (requires root for packet capture)

cd WireShark/cpp-packet-analyzer/build
sudo ./packet_analyzer

Step 2: Start Frontend

cd frontend
npm start

Step 3: Open Browser

Navigate to http://localhost:3000


πŸ”Œ API Reference

Endpoint Method Description Response
/api/packets GET Retrieve captured packets JSON array
/api/stats GET Get capture statistics JSON object
/api/start POST Start packet capture Status
/api/stop POST Stop packet capture Status
/api/clear POST Clear captured packets Status

Example Response (/api/packets)

{
  "packets": [
    {
      "id": 1,
      "timestamp": "2025-12-25 17:44:20",
      "source": "192.168.1.36",
      "destination": "140.82.113.21",
      "protocol": "TCP",
      "length": 54,
      "info": "HTTPS/TLS"
    }
  ],
  "total": 882,
  "capturing": true
}

πŸ“– Usage Guide

Action How To
Start Capture Click the green "β–Ά Start Capture" button
Stop Capture Click the red "⏹ Stop Capture" button
View Packets Packets appear in real-time in the table
Filter Packets Use the filter input to search by IP/protocol
View Statistics Check the right sidebar for live stats
Export Data Click "πŸ“₯ Export JSON" to download packets
Refresh Data Click "πŸ”„ Refresh" to manually update

πŸ› οΈ Development

Backend Development

# Debug build
cd WireShark/cpp-packet-analyzer/build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make

# Run tests
make test

# Clean build
make clean

Frontend Development

cd frontend

# Development server with hot reload
npm start

# Production build
npm run build

# Run tests
npm test

# Lint code
npm run lint

πŸ”’ Security Considerations

⚠️ Important: This tool requires root/administrator privileges to capture packets.

  • Only run on networks you own or have permission to monitor
  • Be aware of privacy laws in your jurisdiction
  • Do not use for malicious purposes
  • Captured data may contain sensitive information

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


Built with ❀️ for network enthusiasts

If you find this project useful, please consider giving it a ⭐

About

WireShark in c++ ,Real-time packet capture showing live network traffic analysis with protocol statisticsA lightweight, real-time network packet analyzer with modern web interface Capture, analyze, and visualize network traffic with ease

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors