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.bat
On macOS/Linux:
./rustshark.sh
Both launcher scripts support the following options:
quick
orrun
: 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 quick
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
The application can be configured using:
- Environment variables in
.env
file - 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.