Skip to content

Guardian is a production-ready AI-powered penetration testing automation CLI tool that leverages Google Gemini and LangChain to orchestrate intelligent, step-by-step penetration testing workflows while maintaining ethical hacking standards.

License

Notifications You must be signed in to change notification settings

zakirkun/guardian-cli

Repository files navigation

Guardian Logo

πŸ” Guardian

AI-Powered Penetration Testing Automation Platform

License: MIT Python 3.11+ Code style: black

Guardian is an enterprise-grade AI-powered penetration testing automation framework that combines the strategic reasoning of Google Gemini with battle-tested security tools to deliver intelligent, adaptive security assessments.

Features β€’ Installation β€’ Quick Start β€’ Documentation β€’ Contributing


⚠️ Legal Disclaimer

Guardian is designed exclusively for authorized security testing and educational purposes.

  • βœ… Legal Use: Authorized penetration testing, security research, educational environments
  • ❌ Illegal Use: Unauthorized access, malicious activities, any form of cyber attack

You are fully responsible for ensuring you have explicit written permission before testing any system. Unauthorized access to computer systems is illegal under laws including the Computer Fraud and Abuse Act (CFAA), GDPR, and equivalent international legislation.

By using Guardian, you agree to use it only on systems you own or have explicit authorization to test.


✨ Features

πŸ€– AI-Powered Intelligence

  • Multi-Agent Architecture: Specialized AI agents (Planner, Tool Selector, Analyst, Reporter) collaborate for comprehensive security assessments
  • Strategic Decision Making: Google Gemini analyzes findings and determines optimal next steps
  • Adaptive Testing: AI adjusts tactics based on discovered vulnerabilities and system responses
  • False Positive Filtering: Intelligent analysis reduces noise and focuses on real vulnerabilities

πŸ› οΈ Extensive Tool Arsenal

15 Integrated Security Tools:

  • Network: Nmap (comprehensive port scanning), Masscan (ultra-fast scanning)
  • Web Reconnaissance: httpx (HTTP probing), WhatWeb (technology fingerprinting), Wafw00f (WAF detection)
  • Subdomain Discovery: Subfinder (passive enumeration), Amass (active/passive mapping)
  • Vulnerability Scanning: Nuclei (template-based), Nikto (web vulnerabilities), SQLMap (SQL injection), WPScan (WordPress)
  • SSL/TLS Testing: TestSSL (cipher analysis), SSLyze (advanced configuration analysis)
  • Content Discovery: Gobuster (directory brute forcing), FFuf (advanced web fuzzing)

πŸ”’ Security & Compliance

  • Scope Validation: Automatic blacklisting of private networks and unauthorized targets
  • Audit Logging: Complete transparency with detailed logs of all AI decisions and actions
  • Human-in-the-Loop: Configurable confirmation prompts for sensitive operations
  • Safe Mode: Prevents destructive actions by default

πŸ“Š Professional Reporting

  • Multiple Formats: Markdown, HTML, and JSON reports
  • Executive Summaries: Non-technical overviews for stakeholders
  • Technical Deep-Dives: Detailed findings with evidence and remediation steps
  • AI Decision Traces: Full transparency into AI reasoning process

⚑ Performance & Efficiency

  • Asynchronous Execution: Parallel tool execution for faster assessments
  • Workflow Automation: Predefined workflows (Recon, Web, Network, Autonomous)
  • Customizable: Create custom tools and workflows via simple YAML/Python

πŸ“‹ Prerequisites

Required

Optional Tools (for full functionality)

Guardian can intelligently use these tools if installed:

Tool Purpose Installation
nmap Port scanning apt install nmap / choco install nmap
masscan Ultra-fast scan apt install masscan / Build from source
httpx HTTP probing go install github.com/projectdiscovery/httpx/cmd/httpx@latest
subfinder Subdomain enum go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
amass Network mapping go install github.com/owasp-amass/amass/v4/...@master
nuclei Vuln scanning go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
whatweb Tech fingerprint gem install whatweb / apt install whatweb
wafw00f WAF detection pip install wafw00f
nikto Web vuln scan apt install nikto
sqlmap SQL injection pip install sqlmap / apt install sqlmap
wpscan WordPress scan gem install wpscan
testssl SSL/TLS testing Download from testssl.sh
sslyze SSL/TLS analysis pip install sslyze
gobuster Directory brute go install github.com/OJ/gobuster/v3@latest
ffuf Web fuzzing go install github.com/ffuf/ffuf/v2@latest
arjun Parameter discovery pip install arjun
xsstrike Advanced XSS git clone ...
gitleaks Secret scanning go install github.com/zricethezav/gitleaks/v8@latest
cmseek CMS detection pip install cmseek
dnsrecon DNS enumeration pip install dnsrecon

Note: Guardian works without external tools but with limited scanning capabilities. The AI will adapt based on available tools.


πŸš€ Installation

Option 1: Docker (Recommended - All Tools Included) 🐳

Easiest and fastest way to get started with all 15 security tools pre-installed!

# Clone repository
git clone https://github.com/zakirkun/guardian-cli.git
cd guardian-cli

# Create .env file with your API key
echo "GOOGLE_API_KEY=your_api_key_here" > .env

# Build Docker image (one-time, ~5 minutes)
docker-compose build

# Run Guardian
docker-compose run --rm guardian recon --domain example.com

Benefits:

  • βœ… All 15 tools pre-installed (nmap, httpx, nuclei, sqlmap, etc.)
  • βœ… No manual tool installation required
  • βœ… Consistent environment across all systems
  • βœ… Isolated and secure

See Docker Guide for advanced usage.


Option 2: Local Installation (Customizable)

Step 1: Clone Repository

git clone https://github.com/zakirkun/guardian-cli.git
cd guardian-cli

Step 2: Set Up Python Environment

Linux/macOS:

python3 -m venv venv
source venv/bin/activate
pip install -e .

Windows:

python -m venv venv
.\venv\Scripts\activate
pip install -e .

Step 3: Initialize Configuration

# Linux/macOS
python -m cli.main init

# Windows
python -m cli.main init
# or use the batch launcher
.\guardian.bat init

During initialization, you'll be prompted for your Gemini API key. Alternatively, create a .env file:

echo "GOOGLE_API_KEY=your_api_key_here" > .env

🎯 Quick Start

Basic Commands

# List available workflows
python -m cli.main workflow list

# Dry run (see execution plan without running)
python -m cli.main recon --domain example.com --dry-run

Example Usage Scenarios

1. Quick Web Application Scan

# Fast security check of a web application
python -m cli.main workflow run --name web --target https://example.com

2. Comprehensive Network Assessment

# Full network penetration test
python -m cli.main workflow run --name network --target 192.168.1.0/24

3. Subdomain Reconnaissance

# Discover and analyze subdomains
python -m cli.main recon --domain example.com

4. Autonomous AI-Driven Test

# Let AI decide each step dynamically
python -m cli.main workflow run --name autonomous --target example.com

5. Generate Professional Report

# Create HTML report from previous scan
python -m cli.main report --session 20251222_120000 --format html

6. Explain AI Decisions

# View AI decision-making process
python -m cli.main ai --last

Windows Users: Use python -m cli.main or .\guardian.bat instead of guardian


πŸ“– Documentation

User Guides

Developer Guides

Architecture

  • Multi-Agent System: Planner β†’ Tool Selector β†’ Analyst β†’ Reporter
  • AI-Driven: Google Gemini for strategic decision-making
  • Modular: Easy to extend with new tools and workflows

πŸ—οΈ Project Structure

guardian-cli/
β”œβ”€β”€ ai/                    # AI integration (Gemini client, prompts)
β”œβ”€β”€ cli/                   # Command-line interface
β”‚   └── commands/         # CLI commands (init, scan, recon, etc.)
β”œβ”€β”€ core/                  # Core agent system
β”‚   β”œβ”€β”€ agent.py          # Base agent
β”‚   β”œβ”€β”€ planner.py        # Planner agent
β”‚   β”œβ”€β”€ tool_agent.py     # Tool selection agent
β”‚   β”œβ”€β”€ analyst_agent.py  # Analysis agent
β”‚   β”œβ”€β”€ reporter_agent.py # Reporting agent
β”‚   β”œβ”€β”€ memory.py         # State management
β”‚   └── workflow.py       # Workflow orchestration
β”œβ”€β”€ tools/                 # Pentesting tool wrappers
β”‚   β”œβ”€β”€ nmap.py           # Nmap integration
β”‚   β”œβ”€β”€ masscan.py        # Masscan integration
β”‚   β”œβ”€β”€ httpx.py          # httpx integration
β”‚   β”œβ”€β”€ subfinder.py      # Subfinder integration
β”‚   β”œβ”€β”€ amass.py          # Amass integration
β”‚   β”œβ”€β”€ nuclei.py         # Nuclei integration
β”‚   β”œβ”€β”€ sqlmap.py         # SQLMap integration
β”‚   β”œβ”€β”€ wpscan.py         # WPScan integration
β”‚   β”œβ”€β”€ whatweb.py        # WhatWeb integration
β”‚   β”œβ”€β”€ wafw00f.py        # Wafw00f integration
β”‚   β”œβ”€β”€ nikto.py          # Nikto integration
β”‚   β”œβ”€β”€ testssl.py        # TestSSL integration
β”‚   β”œβ”€β”€ sslyze.py         # SSLyze integration
β”‚   β”œβ”€β”€ gobuster.py       # Gobuster integration
β”‚   β”œβ”€β”€ ffuf.py           # FFuf integration
β”‚   └── ...               # 15 tools total
β”œβ”€β”€ workflows/             # Workflow definitions (YAML)
β”œβ”€β”€ utils/                 # Utilities (logging, validation)
β”œβ”€β”€ config/                # Configuration files
β”œβ”€β”€ docs/                  # Documentation
└── reports/               # Generated reports

πŸ”§ Configuration

Edit config/guardian.yaml to customize:

ai:
  provider: gemini
  model: gemini-1.5-pro
  temperature: 0.2

pentest:
  safe_mode: true              # Prevent destructive actions
  require_confirmation: true   # Confirm before each step
  max_parallel_tools: 3        # Concurrent tool execution

scope:
  blacklist:                   # Never scan these
    - 127.0.0.0/8
    - 10.0.0.0/8

🀝 Contributing

We welcome contributions! Here's how:

Setting Up Development Environment

# Fork and clone
git clone https://github.com/zakirkun/guardian-cli.git
cd guardian-cli

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/

# Format code
black .

Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Areas for Contribution

  • πŸ› οΈ New Tool Integrations - Add more security tools
  • πŸ”„ Custom Workflows - Share your workflow templates
  • πŸ› Bug Fixes - Report and fix issues
  • πŸ“š Documentation - Improve guides and examples
  • πŸ§ͺ Testing - Expand test coverage

See CONTRIBUTING.md for detailed guidelines.


πŸ“Š Roadmap

  • Web Dashboard for visualization
  • PostgreSQL backend for multi-session tracking
  • MITRE ATT&CK mapping for findings
  • Plugin system for custom modules
  • Integration with CI/CD pipelines
  • Additional AI models support (Claude, GPT-4)
  • Mobile app for on-the-go assessments

πŸ› Troubleshooting

Common Issues

Import Errors

# Reinstall dependencies
pip install -e . --force-reinstall

API Rate Limits

  • Free tier: 2 requests/minute
  • Switch to paid tier or implement request throttling
  • Configure in config/guardian.yaml: ai.rate_limit: 60

Tool Not Found

# Check tool availability
which nmap
which httpx

# Install missing tools (see Prerequisites)

Windows Command Not Found

# Use full command
python -m cli.main --help

# Or use batch launcher
.\guardian.bat --help

For more help, open an issue.


πŸ“„ License

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

MIT License

Copyright (c) 2025 Guardian Project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

πŸ™ Acknowledgments

  • Google Gemini - AI capabilities
  • LangChain - AI orchestration framework
  • ProjectDiscovery - Open-source security tools (httpx, subfinder, nuclei)
  • Nmap - Network exploration and security auditing
  • The Security Community - Tool developers and researchers

πŸ“ž Support & Contact


⭐ Star History

If you find Guardian useful, please consider giving it a star! ⭐


Guardian - Intelligent, Ethical, Automated Penetration Testing

Made with ❀️ by the Security Community

⬆ Back to Top

About

Guardian is a production-ready AI-powered penetration testing automation CLI tool that leverages Google Gemini and LangChain to orchestrate intelligent, step-by-step penetration testing workflows while maintaining ethical hacking standards.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published