A powerful, modular orchestrator for managing captive portals and access points. Built with a high-performance Rust core, Go API server, and intuitive CLI interface for seamless AP management.
- π Modular Architecture - Rust core, Go API, and CLI client working in harmony
- π― Captive Portal Runtime - Advanced packet capture and portal management
- π Plugin System - Rust/WASM plugin support for extensibility
- π REST API - Full-featured API for programmatic control
- ποΈ Interactive CLI - User-friendly command-line interface
- π Wi-Fi Management - hostapd and dnsmasq integration
- π Credential Capture - Portal credential tracking and management
- π₯ Firewall Control - Dynamic firewall rules for captive portal
- π³ Docker Support - Containerization for easy deployment
AP1/
βββ core/ # Rust engine - captive portal runtime, packet capture, plugin management
βββ api/ # Go REST API server - session management and core coordination
βββ cli/ # Command-line client - profile and service management
βββ plugins/ # Plugin system with Rust/WASM support
βββ system/ # OS wrappers and network integrations
βββ config/ # YAML configurations and portal templates
βββ docker/ # Docker setup and deployment scripts
βββ docs/ # Architecture and setup documentation
βββ Makefile # Build automation
βββ install.sh # Dependency installation script
βββ start.sh # Service startup script
βββ ap1 # Interactive orchestrator wrapper
- Rust 1.70+
- Go 1.20+
- Linux (tested on Ubuntu 20.04+)
- Root/sudo access (for network operations)
-
Clone the repository:
git clone https://github.com/PIXELQUADRO07/AP1.git cd AP1 -
Install dependencies:
./install.sh
-
Build all components:
make core make api
Option 1: Interactive Orchestrator (Recommended)
./ap1 startOption 2: Individual Components
Start the Rust core:
cd core
cargo run
# With custom config:
AP1_CONFIG_PATH=../config/global.yaml AP1_PLUGIN_CONFIG_PATH=../config/plugins.yaml cargo runStart the Go API server:
cd ../api
go run .
# With custom flags:
go run . -config ../config/global.yaml -plugins ../config/plugins.yaml -addr :8080Start the CLI client:
cd cli
go run . --help./ap1 status # Check overall system status
./ap1 config # View global configuration./ap1 profiles list # List available profiles
./ap1 profiles select <profile-name> # Activate a profile./ap1 plugins list # List available plugins
./ap1 plugins toggle <plugin-name> on # Enable a plugin
./ap1 plugins toggle <plugin-name> off # Disable a plugin
./ap1 plugins start <plugin-name> # Start an external plugin
./ap1 plugins stop <plugin-name> # Stop a running plugin./ap1 system hostapd restart # Restart hostapd
./ap1 system dnsmasq restart # Restart dnsmasq
./ap1 firewall apply <interface> <gateway-ip> # Apply captive portal rules
./ap1 firewall clear <interface> # Clear firewall rules
./ap1 interface configure <interface> <ip> <subnet-mask> # Configure network interface./ap1 scan <interface> # Scan for available Wi-Fi networks| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
API server health check |
GET |
/api/status |
Core status and configuration |
GET |
/status |
Simplified core status |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/config |
Global configuration (JSON) |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/profiles |
List all AP profiles |
POST |
/api/profiles/select |
Select and apply active AP profile |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/plugins |
List available plugins |
POST |
/api/plugins/toggle |
Enable/disable a plugin |
POST |
/api/plugins/start |
Start external plugin |
POST |
/api/plugins/stop |
Stop running plugin |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/interfaces |
List local network interfaces |
POST |
/api/system/interface/configure |
Configure IP and subnet |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/recon/networks?iface=<iface> |
Perform Wi-Fi scan on interface |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/portal/status |
Captive portal status |
GET |
/api/portal/credentials |
Retrieved portal credentials |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/system/hostapd/<action> |
Manage hostapd (start/stop/restart) |
POST |
/api/system/dnsmasq/<action> |
Manage dnsmasq (start/stop/restart) |
POST |
/api/system/firewall/apply |
Apply captive portal firewall rules |
POST |
/api/system/firewall/clear |
Clear firewall rules |
# Build Docker image
docker build -f docker/Dockerfile -t ap1:latest .
# Run container
docker run -it --privileged -v /etc/ap1:/config ap1:latest- Architecture Guide - System design and component interaction
- Configuration Guide - Setup and customization
- Plugin Development - Building custom plugins
- API Reference - Detailed endpoint documentation
- Fake Connection Mode - Evil twin / captive portal behavior
# Build everything
make all
# Build specific components
make core # Build Rust core
make api # Build Go API
make cli # Build CLI
# Clean build artifacts
make cleancd core
cargo test
cd ../api
go test ./...
cd ../cli
go test ./...Edit config/global.yaml to customize:
- AP profiles and settings
- Portal templates
- Plugin configurations
- System parameters
Example:
profiles:
- name: default
interface: wlan0
gateway: 192.168.50.1
subnet: 24
plugins:
- name: captive-portal
enabled: trueThis tool is designed for authorized testing and educational purposes only. Unauthorized access to networks is illegal. Always ensure you have proper authorization before using AP1.
This project is provided as-is for educational and authorized testing purposes.
Contributions are welcome! Please ensure your code:
- Follows Rust/Go best practices
- Includes comprehensive tests
- Updates documentation accordingly
- Has clear commit messages
For issues, questions, or suggestions:
- Open an Issue
- Check existing Documentation
- Review Architecture
- Enhanced plugin marketplace
- Web-based dashboard
- Advanced analytics and logging
- Multi-AP orchestration
- Cloud integration
- Extended plugin library
AP1 - Powerful AP Management Made Simple π