Skip to content
h45shPublic

About

The deterministic terminal workstation & pedagogical lab for cybersecurity tools.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

122 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CyGuide

The deterministic terminal workstation & pedagogical lab for cybersecurity tools.

PyPI Β· Documentation Hub Β· Roadmap Β· Contributing Β· Security Policy Β· Video Walkthrough Β· Website

CI CodeQL PyPI Python Docker License: MIT

CyGuide transforms penetration testing and security learning from disorganized terminal tabs into an integrated, stateful terminal workstation. It orchestrates industry-standard security tools (nmap, gobuster, nikto, whois, subfinder, dnspython, searchsploit, ffuf, nuclei, sqlmap, netexec), normalizes their outputs into a live entity graph, resolves contextual target variables dynamically, and provides real-time explanations through local (Ollama) or cloud AI modelsβ€”backed by strict subprocess isolation, SSRF gating, and token spend guardrails.

CyGuide Power Mode Terminal Workstation Demo
🎬 Watch the Full Terminal Workstation Video Walkthrough (assets/demo.mp4)


Why CyGuide?

  • No More Terminal Tab Chaos: Run multiple reconnaissance tools concurrently with dedicated tabs, active job monitoring, and instant output review.
  • Stateful Entity Graph: Discoveries (hosts, open ports, endpoints, DNS records, vulnerabilities) automatically link together in a deterministic graph using SHA-256 Primary Identity Keys (PIKs).
  • Universal Variable Injection: Click any node in your target tree to bind variables ($TARGET, $PORT, $SERVICE) into subsequent commands without retyping IP addresses.
  • Deterministic Execution & Safety Guardrails: Non-shell subprocess execution vectors (asyncio.create_subprocess_exec), Link-Local/cloud metadata SSRF gating (169.254.0.0/16), and child environment secret scrubbing protect operator credentials.
  • Offline-First AI Tutor with Token Guardrails: Get immediate, structured breakdowns of scan results and security recommendations powered by local Ollama models or cloud APIs, guarded by token spend caps (max_tokens: 1500), automatic 429 rate-limit backoff, and sensitive artifact redaction.
  • Portable Engagement Archives: Export investigations into standalone .db archives and Markdown reports (cyg session export). Instructors can import (cyg session import) and replay a student's exact methodology step-by-step.

Workstation Interface

CyGuide features two distinct terminal operational modes and an integrated diagnostic suite:

1. Power Mode (Multi-Tab Concurrent Workbench)

Run multiple asynchronous security tools concurrently, interact with live target graphs, and resolve $TARGET, $PORT, and $SERVICE variables on the fly:

CyGuide Power Mode

2. Dashboard Hub (Workspace & Session Management)

Organize complex penetration tests and CTFs into discrete workspaces and isolated sessions with full archive, rename, and export support (Ctrl+N, Ctrl+S):

CyGuide Dashboard Hub

3. Guided Learning Mode & Interactive Tool Browser

Explore tool recipes, inspect command flags before execution, and receive AI-guided security breakdowns and hardening steps. Features universal multi-tool lab progression (retaining per-tool flags/targets as you switch between tools), unified knowledge graph tracking (Ctrl+G), lab notes with direct Markdown export, and full lab session quicksave checkpoints (.cyglab, Ctrl+S / Ctrl+O):

CyGuide Guided Learning Mode

CyGuide Learning Mode Tool Selection

4. In-App Diagnostics & Unified Command Palette

Inspect security binary availability on $PATH in real time with Ctrl+P -> Tool Health, and configure AI providers, database paths, and custom plugins:

CyGuide Tool Health Diagnostics

CyGuide Command Palette

5. Domain-Driven CLI & Headless Operations (cyg CLI)

Audit system readiness, inspect security tool ecosystems, manage workspaces, and export forensic graphs directly from your terminal:

CyGuide CLI Interface & Subcommands


Architecture Overview

CyGuide is built on a Smart Adapter / Stupid Framework model:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Textual TUI Workstation                         β”‚
β”‚  [ Dashboard Hub ]   [ Guided Learning Mode ]   [ Power Mode Workbench]β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚ Actions / Context
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       Deterministic Core Engine                        β”‚
β”‚  β€’ ActionGateway (SSRF & Scope Policy)  β€’ ExecutionSession (PTY Spool) β”‚
β”‚  β€’ GraphStore (PIK Deduplication)       β€’ ActionTimelineRepository     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚ Event Streaming
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Security Tool Adapters                         β”‚
β”‚  nmap β€’ gobuster β€’ nikto β€’ whois β€’ subfinder β€’ dnspython β€’ ffuf β€’ nucleiβ”‚
β”‚       β€’ searchsploit β€’ sqlmap β€’ netexec β€’ custom plugins...            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Core Engine (cyguide/engine): Asynchronous process execution sessions with disk spooling, policy gateway, action timeline repository, workspace repository, and SQLite graph store.
  • Unified Schemas (cyguide/schemas): 18 standard Pydantic models defining shared security entities with declarative canonicalization.
  • Smart Adapters (tools/): Isolated plugins that construct commands and parse streaming output.
  • Textual TUI (cyguide/ui): Fast, keyboard-driven terminal interface with split panes and scratchpad.

Installation & Getting Started

CyGuide can be run or installed through several methods depending on your workflow:

Method Best For Security Tools Setup Time
Docker (GHCR) Quick trials, isolated testing, zero host pollution Pre-bundled < 30 seconds
pipx Everyday CLI usage on Linux/macOS Installed via script/OS ~ 1 minute
pip / PyPI Existing Python virtual environments Installed via script/OS ~ 1 minute
Source (Git) Contributing, local tool plugin development Installed via script/OS ~ 2 minutes

Option 1: Instant Evaluation via Docker (Zero Setup)

Run CyGuide immediately with Python 3.11+ and pre-bundled security tools inside an isolated container:

docker run -it --rm --net=host -v ~/.cyguide:/root/.cyguide ghcr.io/h45sh/cyguide

Note

--net=host allows network scanners to probe target hosts seamlessly, and -v ~/.cyguide:/root/.cyguide ensures your session graphs, notes, and reports persist on your host machine.


Option 2: Install via pipx (Recommended for Python CLI Users)

Install CyGuide into an isolated application environment:

pipx install cyguide

(Ensure system security tools are installed via the Universal Installer or native package managers below).


Option 3: Install from PyPI or Source

If working inside a virtual environment or contributing to CyGuide:

# Install from PyPI
pip install cyguide

# OR clone and install editable for development
git clone https://github.com/h45sh/cyguide.git
cd cyguide
pip install -e .

Installing Security Tools & Dependencies

CyGuide orchestrates standard CLI security tools. You can install them automatically using our universal installer, or manually with your package manager:

A. Automated Universal Installer (Recommended)

CyGuide includes an intelligent dependency installer that auto-detects your OS and package manager, installs dependencies, handles fallbacks (e.g. downloading official binaries if a tool isn't in your distro repos), and verifies the setup:

# Install system-wide (requires sudo)
./scripts/install_deps.sh

# Install standalone binaries into ~/.local/bin (no root/sudo needed)
./scripts/install_deps.sh --user

# Verify currently installed tools without making changes
./scripts/install_deps.sh --check

B. Native Package Manager Commands

If you prefer to install packages manually using your distribution's native package manager:

Debian / Ubuntu / Linux Mint / Pop!_OS
sudo apt update
sudo apt install -y nmap gobuster nikto whois ffuf libxml-writer-perl curl unzip tar git

# Install subfinder, nuclei, and searchsploit (or run ./scripts/install_deps.sh for automated binaries)
./scripts/install_deps.sh
Kali Linux / Parrot OS
# All tools are natively available in official Kali & Parrot repositories
sudo apt update
sudo apt install -y nmap gobuster nikto whois subfinder ffuf nuclei exploitdb libxml-writer-perl
Arch Linux / Manjaro / EndeavourOS / BlackArch
sudo pacman -Syu --needed nmap gobuster nikto whois subfinder ffuf nuclei exploitdb perl-xml-writer
Fedora / RHEL / CentOS Stream / Rocky / AlmaLinux
sudo dnf install -y nmap whois perl-XML-Writer curl unzip tar git
# Security CLI tools (or run ./scripts/install_deps.sh for automated binaries)
sudo dnf install -y gobuster nikto ffuf 2>/dev/null || ./scripts/install_deps.sh
openSUSE (Tumbleweed / Leap)
sudo zypper install -y nmap whois perl-XML-Writer curl unzip tar git
./scripts/install_deps.sh
Alpine Linux
sudo apk add nmap gobuster nikto whois ffuf perl-xml-writer curl unzip tar git
./scripts/install_deps.sh
macOS (Homebrew)
brew install nmap gobuster nikto whois subfinder ffuf nuclei exploitdb

Launching CyGuide

# Launch with default centralized database (~/.cyguide/cyguide.db)
cyg

# Launch with a custom data directory
cyg --data-dir ~/.my_cyguide

# Launch with a custom SQLite database
cyg --db engagement.db

AI Configuration (Ollama & Cloud)

CyGuide supports both local, privacy-preserving LLMs and cloud APIs:

Local LLM (Ollama)

Launch with the --ollama flag and specify an optional model (defaults to gemma):

cyg --ollama --ollama-model llama3

Cloud LLM Providers

Set your API key via environment variable or in the in-app settings dialog (Ctrl+P -> Configuration):

export CYGUIDE_API_KEY="your_api_key_here"

# Optional overrides (defaults to OpenAI / gpt-4o)
export CYGUIDE_API_TYPE="openai"       # Options: openai, anthropic
export CYGUIDE_API_BASE="https://api.openai.com/v1" # E.g., OpenRouter, Groq, DeepSeek
export CYGUIDE_API_MODEL="gpt-4o"

Diagnostic Health Check & Doctor

Verify your Python runtime, database write permissions, installed security tools, and AI backends:

cyg doctor

(Use cyg doctor --json for scriptable JSON output in CI/CD pipelines).


Session Portability & Reporting

  • Export Session (cyg session export): Creates a portable .db archive of findings, relationships, and raw commands:
    cyg session export <session_id_or_name> exports/my_session.db
  • Generate Technical Report: Produces a structured executive Markdown summary:
    cyg session export <session_id_or_name> exports/my_session.db -r reports/investigation.md
  • Import Session (cyg session import): Restores an archive into your local workspace:
    cyg session import exports/my_session.db -w "My Workspace"
  • Universal Lab Checkpoints & Practice Lab (cyg lab): Manage multi-tool training sessions and launch local mock practice targets:
    cyg lab list
    cyg lab save lesson1 --target 10.10.10.5
    cyg lab load lesson1.cyglab
    cyg lab start --port 8888            # Launch isolated offline mock practice web server

Documentation Hub

Our complete documentation is organized using the DiΓ‘taxis Framework:


Contributing

Contributions are warmly welcomed! Please read our Contributing Guide to learn how to create new tool plugins, configure pre-commit hooks, and run the verification pipeline:

./scripts/verify.sh

Author & Maintainer

CyGuide was conceived, architected, and built from scratch by Harshwardhan Patil (@h45sh).


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The deterministic terminal workstation & pedagogical lab for cybersecurity tools.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages