Implementation:0xSteph Pentest ai agents Doctor Audit
| Knowledge Sources | |
|---|---|
| Domains | DevOps, Configuration, CLI |
| Last Updated | 2026-10-22 12:00 GMT |
Overview
Concrete audit script for verifying CLI tool availability against agent requirements provided by the pentest-ai-agents toolkit.
Description
The doctor.sh script audits which underlying CLI tools (nmap, nuclei, sqlmap, etc.) are installed on the system and maps them to the agents that need them. It produces per-agent reports showing present, missing, and optional tools with install hints. The tool catalog is defined as a `TOOLS` array with pipe-delimited entries: `<binary>|<agent>|<category>|<install hint>`, covering 100+ tool entries across 16 agent categories.
The script supports JSON output for programmatic use, quiet mode for showing only missing required tools, and per-agent filtering. It exits with code 0 when all required tools are present, or 1 when required tools are missing.
Usage
- Full audit: Run `doctor.sh` to see all tools grouped by agent with install hints.
- Per-agent audit: Run `doctor.sh --agent ad-attacker` to check tools for a specific agent.
- Quiet mode: Run `doctor.sh --quiet` to show only missing required tools.
- JSON output: Run `doctor.sh --json` for programmatic parsing.
- After installation: Run after `install.sh --tools` to verify everything installed correctly.
Code Reference
Source Location
- Repository: pentest-ai-agents
- File: db/doctor.sh
Signature
#!/usr/bin/env bash
# Tool catalog: TOOLS array with format "<binary>|<agent>|<category>|<hint>"
# Categories: required, optional, platform
# CLI options:
# --agent <name> Filter to tools used by a specific agent
# --json Emit JSON instead of human-readable output
# --quiet Only show missing required tools
# --no-hints Suppress install hints in human output
# -h, --help Show help
# Exit codes:
# 0 = All required tools present
# 1 = At least one required tool missing
# 2 = Invalid usage
Import
# Run directly:
doctor.sh [--agent <name>] [--json] [--quiet] [--no-hints]
# Or via installed path:
~/.pentest-ai/bin/doctor.sh --json
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| --agent | str | No | Filter to tools for a specific agent (e.g., ad-attacker) |
| --json | flag | No | Output JSON format |
| --quiet | flag | No | Only show missing required tools |
| --no-hints | flag | No | Suppress install hints |
| TOOLS | array | Yes | Internal: 100+ tool catalog entries |
Outputs
| Name | Type | Description |
|---|---|---|
| Audit report | stdout | Per-agent tool status (present/missing/optional) |
| JSON | stdout (JSON) | {"tools": [...], "required_missing": N} |
| Exit code | int | 0=all present, 1=required missing |
Usage Examples
Full Audit
# Check all tools for all agents
doctor.sh
# Output (excerpt):
# pentest-ai tool audit
# recon-advisor (4/6 present)
# ✔ nmap required
# ✘ masscan optional
# ↳ apt install masscan
# ✔ dig required
# Summary
# ✔ 42 / 78 tools detected
# ✘ 3 required tools missing
Per-Agent Audit
# Check only tools needed by the AD attacker agent
doctor.sh --agent ad-attacker
JSON Output for Scripting
# Get JSON output for programmatic use
doctor.sh --json | jq '.required_missing'
# 3
# List all missing required tools
doctor.sh --json | jq '.tools[] | select(.status == "missing" and .category == "required")'
Quiet Mode
# Show only missing required tools (for CI/CD checks)
doctor.sh --quiet
Related Pages
Implements Principles
Requires Environment
Uses Heuristics
Related Implementations
- Implementation:0xSteph_Pentest_ai_agents_Install_Script installs the tools that this script audits