Kali Linux Penetration Testing Skill for AI Agents
The Kali-pentest skill integrates Kali Linux’s 269 command-line tools into AI agents such as Claude Code, OpenClaw, and Hermes Agent. It automates penetration testing workflows by planning attack paths, selecting tools, and adapting strategies based on real-time results. Unlike traditional automated tools, it operates within a Kali environment via SSH, Docker, or local execution, ensuring full toolset compatibility while enforcing human approval gates for high-risk actions. Built-in coverage matrices, zero-findings fallbacks, and objective stopping conditions ensure thorough testing without redundant efforts.
Unauthorized use is prohibited by law, and explicit written permission is required before testing any target.
A demonstration of the skill’s capabilities includes a simulated end-to-end penetration test against two targets: an Ubuntu 24 system (192.168.1.101) with eight services and a Windows Server 2022 system (192.168.1.102) with eight services. The demo illustrates phases such as connectivity verification, host discovery, port scanning, vulnerability detection, and an attack chain discovery—from Redis no-auth exploitation to domain admin credential reuse. The simulation produces a structured report in Markdown and HTML formats, complete with evidence, reproduction steps, and remediation guidance.
Attachments include a full Markdown report and a beautified HTML report with an attack chain diagram and severity badges.
How It Works
Each phase includes mandatory authorization checks and scope confirmation before proceeding. The agent autonomously selects playbooks from a decision tree, executes tools, and integrates findings across phases to adapt the strategy dynamically.
Overall Workflow
- Receive Task: The agent confirms authorization and scope before initiating testing.
- Execute: The agent runs tools in the selected category, collects outputs, and evaluates findings.
- Analyze & Iterate: Results are integrated across phases to refine the attack path. If coverage is insufficient, the agent may request additional instructions or adjust the playbook’s stopping conditions.
- Report: A structured report is generated, including evidence, reproduction steps, and remediation recommendations.
Execution Detail
This iterative process ensures comprehensive coverage while minimizing redundant efforts.
The skill supports three testing depths, controlled via natural language prompts: Quick (fast checks), Standard (default), and Deep (maximum coverage). For example, a user might request a ‘quick scan’ for port enumeration or a ‘full assessment’ for in-depth vulnerability analysis.
Use Cases
Example use cases include:
- Network Penetration Testing: Scanning a target network (e.g., 10.0.0.0/24) for open ports and service versions, with authorization confirmed.
- Web Application Testing: Assessing a web application (e.g., http://192.168.1.50) for vulnerabilities using Docker mode, with a detailed report generated post-testing.
- API Security Testing: Evaluating an API (e.g., https://api.example.com) against authentication, authorization, and schema-driven vulnerabilities using an OpenAPI specification.
- Cloud-Native Security: Conducting a read-only assessment of a Kubernetes cluster and container registry, producing a findings report without modifying production environments.
- Mobile Application Testing: Analyzing an Android APK (e.g., /tmp/app.apk) for static and runtime vulnerabilities, including backend endpoint mapping.
- Wireless Security Assessment: Testing a corporate Wi-Fi network (e.g., CorpWiFi) for passive discovery, handshake capture, WPS detection, and evil twin attacks.
- Source Code and Dependency Audit: Scanning a Git repository (e.g., /tmp/source-repo) for secrets, SAST vulnerabilities, and CI/CD pipeline security flaws.
- VoIP/ICS Protocol Assessment: Evaluating SIP and Modbus services (e.g., 10.10.20.15 and 10.10.30.20) in a conservative, read-only mode to avoid disrupting operations.
The skill is compatible with multiple AI models, including claude-opus-4.6, claude-sonnet-4.6, deepseek-v4-pro, and qwen3.6:27b (for air-gapped environments requiring ≥128K context length).
Tool Integration and Coverage
Kali-pentest includes 269 CLI tools across 14 categories, organized into playbooks for specific scenarios.
Each tool is integrated into workflows that ensure depth, with fallbacks for scenarios yielding no findings.
Autonomous Planning and Adaptation
The agent autonomously plans attack paths by selecting tools based on the target’s characteristics. It integrates results across phases to adapt the strategy, such as shifting from initial reconnaissance to exploitation if vulnerabilities are discovered. Human approval gates are enforced for high-risk actions, ensuring compliance with ethical and legal standards.
Environment Modes
- Local Mode: The agent runs directly on a Kali system, invoking tools via bash without SSH or Docker overhead. Ideal for environments where the AI agent is already on a Kali host.
- Server Mode: The agent connects to a remote Kali server via SSH, avoiding Docker limitations such as networking restrictions or GPU access. Recommended for remote testing.
- Docker Mode: A persistent container pre-installed with the full toolset is used for CLI information gathering, vulnerability scanning, web/API testing, and reporting. Best suited for isolated or cloud-based testing.
Connection details can be configured in TOOLS.md for seamless integration with agents like OpenClaw, reducing manual input during testing.
Reporting and Output
- Evidence of vulnerabilities with reproduction steps.
Authorization and Compliance
Users must explicitly confirm scope and permissions before the agent proceeds, aligning with legal and ethical standards for penetration testing.
