A packet capture and analysis tool built with Rust and Next.js.
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.
- π 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)
- Node.js (v14 or higher)
- npm or yarn
- Rust (for backend development)
- Admin/root privileges (for network capture features)
-
Clone the repository:
git clone https://github.com/ScriptedButton/rustshark.git cd rustshark -
Install dependencies:
npm install
-
Build the backend (required for packet capture):
cargo build --release
We provide convenient launcher scripts for both Windows and Unix-like systems:
On Windows:
.\rustshark.batOn macOS/Linux:
./rustshark.shBoth launcher scripts support the following options:
quickorrun: Start both frontend and backendfrontend: Start only the frontendbackend: Start only the backendbuild: Build the frontendconfig: Edit configuration
Example:
# Windows
.\rustshark.bat quick
# macOS/Linux
./rustshark.sh quickYou can also use the Node.js launcher directly:
node start.jsOr start components individually:
# Start frontend
cd frontend
npm run dev
# Start backend
cargo run --releaseThe application can be configured using:
- Environment variables in
.envfile - 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)
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
-
Build the frontend:
cd frontend npm run build -
Build the backend:
cargo build --release
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.