A comprehensive suite of network scanning tools for local area networks, written in Rust. This is the modern Rust implementation of the go-lanscan project, offering improved performance, safety, and usability.
- ๐ ARP Scanning - Discover active devices on your network
- ๐ SYN Port Scanning - Detect open ports and services on discovered devices
- ๐ฅ๏ธ Terminal UI - Interactive interface for network management and device interaction
- ๐ Library Crate - Build custom network scanning applications
- ๐ High Performance - Optimized Rust implementation with concurrent scanning
- ๐ก๏ธ Memory Safe - Rust's safety guarantees prevent common networking bugs
r-lanscan is organized as a Cargo workspace with three main components:
๐ r-lanlib - Network Scanning Library
The core library providing network scanning capabilities for building custom applications.
use r_lanlib::{network, packet, scanners::*};
// Discover devices on your network
let interface = network::get_default_interface()?;
let scanner = ARPScanner::new(/* ... */);
let devices = scanner.scan()?;
Key Features:
- ARP and SYN scanning implementations
- Flexible target specification (IPs, ranges, CIDR blocks)
- Real-time results via channels
- Vendor lookup and hostname resolution
- Cross-platform network interface detection
๐ฅ๏ธ r-lancli - Command Line Interface
A powerful CLI tool for network reconnaissance and analysis.
# Scan entire local network
sudo r-lancli
# Scan specific targets with custom ports
sudo r-lancli --targets 192.168.1.0/24 --ports 22,80,443,8080
# Export results as JSON
sudo r-lancli --json --quiet > scan_results.json
Key Features:
- Comprehensive network scanning with customizable options
- Human-readable tables and JSON output
- Flexible target and port specification
- Vendor lookup and hostname resolution
- Integration-friendly for scripting and automation
๐ฎ r-lanterm - Terminal UI Application
An interactive terminal user interface for network management and device interaction.
# Launch interactive terminal UI
sudo r-lanterm
# Customize port scanning
sudo r-lanterm --ports 22,80,443,3389,5900
Key Features:
- Real-time network monitoring with live updates
- SSH integration for direct device access
- Built-in traceroute and web browsing (lynx)
- Persistent configuration management
- Multiple color themes and customizable interface
- Device-specific and global SSH configurations
# Clone the repository
git clone https://github.com/robgonnella/r-lanscan
cd r-lanscan
# Build all components
cargo build --release
# Or build individual components
cargo build --release -p r-lanlib
cargo build --release -p r-lancli
cargo build --release -p r-lanterm
The project includes a comprehensive Justfile for common development tasks:
# Install just command runner
cargo install just
# View all available commands
just
# CLI operations
just scan --help # Show CLI help
just scan # Quick network scan
just scan --targets 192.168.1.0/24 # Scan specific network
just scan --arp-only --vendor # ARP scan with vendor lookup
# Terminal UI operations
just term # Launch interactive terminal UI
just term --ports 22,80,443 # Custom port scanning
just term --debug # Run in debug mode
# Development and testing
just test # Run all tests
just test-report # Generate test coverage report
just lint # Run clippy linting
# Docker operations
just up # Start development containers
just exec-workspace # Access container shell
just exec-workspace-term # Run terminal UI in container
just down # Stop containers
just logs # View container logs
Quick Network Scan:
sudo r-lancli --arp-only --vendor --host-names
Comprehensive Port Analysis:
sudo r-lancli --ports 1-1000 --json > network_audit.json
Interactive Network Management:
sudo r-lanterm # Launch terminal UI for full interactive experience
- Rust 1.89.0+ with Rust 2024 edition support - Install via rustup.rs
- Root/Administrator privileges - Required for raw socket operations
- Optional external tools (for terminal UI):
ssh
- For device connectionstraceroute
- For network path analysislynx
- For terminal web browsing
- ๐ Library Documentation - API reference and examples for r-lanlib
- ๐ป CLI Documentation - Complete command-line reference and usage examples
- ๐ฅ๏ธ Terminal UI Documentation - Interactive interface guide and keyboard shortcuts
- Discover all devices on your network segments
- Monitor network changes and new device connections
- Audit open ports and services across your infrastructure
- Quick SSH access to multiple servers and devices
- Identify unauthorized devices on your network
- Detect unexpected open ports and services
- Map network topology and device relationships
- Monitor for security compliance across network segments
- Verify service availability during development
- Test network connectivity and firewall rules
- Debug network issues with integrated diagnostic tools
- Automate network discovery in CI/CD pipelines
# Development build
cargo build
# Release build with optimizations
cargo build --release
# Run tests
cargo test
# Run with coverage reporting
cargo llvm-cov
# Lint code
cargo clippy --all-targets --all-features
The project includes a Docker setup for development and testing:
# Build and start development container
just up
# Access workspace shell
just exec-workspace
# Run terminal UI in container
just exec-workspace-term
# View container logs
just logs
# Stop containers
just down
Note: Docker networking limitations may affect scanning capabilities and performance. For full functionality and optimal performance, run natively on the host system.
r-lanscan/
โโโ lib/ # Core scanning library (r-lanlib)
โโโ cli/ # Command-line interface (r-lancli)
โโโ term/ # Terminal UI application (r-lanterm)
โโโ Cargo.toml # Workspace configuration
- Only scan networks you own or have explicit permission to test
- Be aware that network scanning may trigger security monitoring systems
- Some jurisdictions have laws regulating network scanning activities
- Use responsibly and in accordance with your organization's security policies
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Setting up the development environment
- Running tests and generating coverage reports
- Code style and formatting requirements
- Submitting pull requests
This project is dual-licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
- go-lanscan - Original Go implementation
- ops - Original terminal UI concept
- nmap - Comprehensive network discovery and security auditing