About this project

CERT-X-GEN is built to address the limitations of traditional security scanners, which force all detection logic into restricted YAML DSLs that cannot easily support multi-step protocol conversations, binary protocol parsing, conditional branching, performance-critical operations, or native library access. The core runtime is a language-agnostic execution layer that supports writing detection templates in 12 languages: Python, Go, Rust, C, C++, Java, JavaScript, Ruby, Perl, PHP, Shell, and YAML. It includes compilation caching for compiled languages, parallel template execution with rate limiting, and a simple template contract where templates read target connection details from environment variables, run custom detection logic, and return structured JSON findings. The tool ships two primary workflows: 1. Template scanning via the cxg scan command: Runs polyglot detection templates against targets defined as single hosts, target lists in files, CIDR ranges, URLs, or local CLI binaries. It supports glob-based template selection, custom port ranges, and multiple output formats (JSON, CSV, SARIF, HTML, Markdown) optimized for pipeline integration. 2. AI-driven whitebox pentesting via the cxg pentest command: Leverages source code analysis findings to rank security hypotheses, uses configurable AI providers (Claude, Codex, Gemini, Anthropic, OpenAI, or custom bridge endpoints) to generate JavaScript probe templates, and executes probes in authenticated Chromium contexts against web applications or Electron desktop apps. It includes built-in session management for authenticated testing, a CI mode that fails hard on expired sessions to avoid unauthenticated probing, and structured reports that link findings back to original source code exposure claims. Additional CLI capabilities include cxg build for compiling instrumented targets with sanitizers to validate scan verdicts, cxg template for managing the separate Git-hosted official template library, cxg search for full-text and regex template lookup, cxg ai for AI-powered template generation, cxg mcp to run as a Model Context Protocol server for AI agent integration, cxg sandbox for managing per-language dependency environments, cxg config for configuration generation and validation, cxg update for self-updating, and cxg version for version checks. The planned cxg server REST API is not yet implemented. Installation options include Cargo (crates.io), Homebrew, a quick curl install script, pre-built Docker images, static binaries for Linux, macOS, and Windows, and source builds. Users are advised to exercise caution when running templates, as templates execute as child processes with the invoking user's full network and filesystem access, with no built-in sandboxing or resource limiting. The project is licensed under Apache 2.0, with official documentation hosted at docs.bugb.io/cxg/.