Skip to content

A packet capture and analysis tool built with Rust and Next.js.

ScriptedButton/rustshark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rustshark

A packet capture and analysis tool built with Rust and Next.js.

Overview

Rustshark is a network packet capture and analysis tool that provides a modern web interface for capturing, analyzing, and visualizing network traffic. It combines the speed and efficiency of Rust for packet processing with the flexibility and ease of use of a web-based UI built with Next.js.

Features

  • πŸ” Real-time packet capture and analysis
  • πŸ“Š Detailed packet information display
  • πŸ“ˆ Traffic visualization and statistics
  • πŸ”Ž Advanced filtering capabilities
  • πŸ’Ύ Save and load packet captures
  • 🌐 Cross-platform support (Windows, macOS, Linux)

Quick Start

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Rust (for backend development)
  • Admin/root privileges (for network capture features)

Installation

  1. Clone the repository:

    git clone https://github.com/ScriptedButton/rustshark.git
    cd rustshark
  2. Install dependencies:

    npm install
  3. Build the backend (required for packet capture):

    cargo build --release

Running the Application

Using the Launcher Scripts

We provide convenient launcher scripts for both Windows and Unix-like systems:

On Windows:

.\rustshark.bat

On macOS/Linux:

./rustshark.sh

Command-line Options

Both launcher scripts support the following options:

  • quick or run: Start both frontend and backend
  • frontend: Start only the frontend
  • backend: Start only the backend
  • build: Build the frontend
  • config: Edit configuration

Example:

# Windows
.\rustshark.bat quick

# macOS/Linux
./rustshark.sh quick

Manual Start

You can also use the Node.js launcher directly:

node start.js

Or start components individually:

# Start frontend
cd frontend
npm run dev

# Start backend
cargo run --release

Configuration

The application can be configured using:

  1. Environment variables in .env file
  2. Configuration file at rustshark.config.json

Key configuration options:

  • FRONTEND_PORT: Port for the web interface (default: 3000)
  • BACKEND_PORT: Port for the Rust backend (default: 3001)
  • NODE_ENV: Environment mode (development or production)

Development

Project Structure

rustshark/
β”œβ”€β”€ frontend/           # Next.js frontend
β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”œβ”€β”€ pages/          # Next.js pages
β”‚   β”œβ”€β”€ public/         # Static assets
β”‚   └── styles/         # CSS styles
β”œβ”€β”€ src/                # Rust backend
β”‚   β”œβ”€β”€ capture/        # Packet capture logic
β”‚   β”œβ”€β”€ analysis/       # Packet analysis modules
β”‚   └── api/            # API endpoints
β”œβ”€β”€ rustshark.sh        # Unix launcher script
β”œβ”€β”€ rustshark.bat       # Windows launcher script
└── start.js            # Node.js launcher script

Building for Production

  1. Build the frontend:

    cd frontend
    npm run build
  2. Build the backend:

    cargo build --release

Contributing

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

License

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

Acknowledgments

About

A packet capture and analysis tool built with Rust and Next.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published