Polaris
How It Works
Polaris is a Flask/SocketIO C2 (Command and Control) server manager and real-time connection dashboard. It manages and monitors three core services — Chisel reverse tunnel server, iodined DNS tunnel server, and Metasploit Framework console — providing a unified web dashboard on port 5900 for tracking connected pentest appliances and active tunnels.
Architecture: Polaris consists of three layers:
- Supervisor (
supervisor.py) — Process lifecycle manager that starts, stops, restarts, and re-attaches to the three managed services. Processes are launched detached (new session) and tracked via PID files in/var/run/. The supervisor survives Polaris restarts by re-attaching to running processes on startup. - Monitors (
monitor.py) — Four background polling threads that collect live state:- ChiselMonitor — Tails
/var/log/chisel.log, parses session open/close and proxy-listener events via regex. Replays the log on startup to reconstruct current session state. Detects chisel server restarts (clears stale sessions). Clears all sessions if the chisel server process is not running. - ServiceHealthCheck — Polls
pgrepevery 10 seconds to check if chisel server, iodined, and msfconsole processes are alive. Emits SocketIO events on state changes. - IodineMonitor — Probes the DNS tunnel subnet (default 10.53.53.0/24) with ICMP pings every 15 seconds to detect connected iodine clients. Checks
/sys/class/net/dns0for tunnel interface existence. - MetasploitMonitor — Captures the tmux pane output (last 200 lines) from the
polaris-msfsession, parsing "Meterpreter session N opened" / "session N closed" events. Also reads/var/run/polaris_sessions.jsonas a fallback data source.
- ChiselMonitor — Tails
- Device Registry — Maps hostnames to device IDs via
device_registry.json. Device IDs are used to compute per-appliance port offsets for Vantage (25100+id), Crucible (25500+id), Nessus (28834+id), and SOCKS (1081+id) tunnels.
Dashboard API: The /api/status endpoint aggregates all monitor data into a unified view showing per-appliance connection state (chisel connected, DNS tunnel active, Meterpreter session), computed tunnel ports, service health, supervisor status, and a rolling event timeline (last 200 events).
Service Control: REST endpoints (/api/service/<name>/start|stop|restart, /api/start-all, /api/stop-all) allow starting, stopping, and restarting services through the web UI. The supervisor handles port conflicts, stale process cleanup, orphan detection, and automatic TLS certificate generation for Chisel.
Security
Polaris runs without authentication by design. It is deployed exclusively on the C2 server and is not intended to be exposed to the internet or to pentest targets. The SECRET_KEY is randomly generated at startup (not persisted). SocketIO CORS is set to allow all origins since the dashboard is accessed from the operator's workstation.
TLS for Chisel: The supervisor automatically generates a self-signed TLS certificate (ECDSA prime256v1, 10-year validity) for the Chisel server if none is configured, stored in the keys/ directory. Custom certificates can be specified in config.yaml.
Firewall Management: The supervisor automatically opens required UFW ports (Chisel listen port TCP, DNS port 53/udp, C2 callback ports) when starting services.
Features
Configuration
Dashboard
Firewall
Monitoring
Security
Service Management
Use Cases
Multi-Appliance Pentest C2 Hub
Deploy Polaris on the C2 server to manage reverse tunnels from multiple pentest appliances. Each appliance connects via Chisel, and Polaris tracks which appliances are online, their tunnel ports, and active Meterpreter sessions from a single dashboard.
Chisel Reverse Tunnel Orchestration
Use Polaris to start and monitor the Chisel server with TLS and authentication. The dashboard shows which appliances have active tunnel sessions and their assigned port mappings for Vantage, Crucible, and Nessus access through the tunnel.
DNS Tunnel Fallback Management
When Chisel (TCP) tunnels are blocked, use Polaris to manage iodined DNS tunnels as a fallback channel. The iodine monitor detects which clients are reachable through the DNS tunnel subnet via ICMP probes.
Metasploit Session Dashboard
Track Meterpreter sessions from a single dashboard alongside tunnel connections. Polaris parses msfconsole output from the tmux session to show active session IDs, remote IPs, and associated hostnames.
Service Recovery After Reboot
After a C2 server reboot, Polaris re-attaches to any services that survived (via PID files) and can restart those that did not, maintaining tunnel continuity with minimal manual intervention.
CLI Reference
Third-Party Tool Invocations
Commands and flags used when this tool invokes third-party dependencies during operation.
Invocation Methods
| Method | Usage |
|---|---|
| CLI — Direct |
cd /opt/pr0t31n/Polaris && python3 app.py
Run directly with command-line arguments. |
| CLI — Settings File |
cd /opt/pr0t31n/Polaris && python3 app.py --config config.yaml
Configure via config.yaml (YAML), then run. |
| Web UI |
https://localhost:5900
Flask web interface — start the app then open in browser. |
Integration
Depends On
- LandNav (drop device)
Used By
- Nexus (health check)
Third-Party Dependencies & Credits
| Tool / Library | Developer | Type | Link |
|---|---|---|---|
| Flask | Pallets / Armin Ronacher | python | https://github.com/pallets/flask |
| Flask-SocketIO | Miguel Grinberg | python | https://github.com/miguelgrinberg/Flask-SocketIO |
| chisel | Jaime Pillora (jpillora) | system | https://github.com/jpillora/chisel |
| iodine / iodined | Erik Ekman (yarrick) | system | https://github.com/yarrick/iodine |
| Metasploit Framework | Rapid7 | system | https://github.com/rapid7/metasploit-framework |
Metadata
| Name | Polaris |
| Category | Egress & Control |
| Version | 1.2.4 |
| Install Path | /opt/pr0t31n/Polaris |
| Main File | app.py |
| Port | 5900 |
| GitHub | https://github.com/pr0t31n/Polaris.git |
| Requires | LandNav |