PWN::Plugins::YubiKey::Management
Native device information/configuration over OTP HID, management smartcard or
CTAP vendor commands. No executable, subprocess, interpreter or network backend.
API and routing
execute(args: [...], connection: ...) takes argv after config.
operations lists five prior leaves: usb, nfc, mode, set-lock-code, reset.
Empty args return local metadata without device I/O. --force is not consent.
Typed APIs: info, configure_usb, configure_nfc, set_mode, set_lock_code,
reset, reboot, help, authors. See runtime help for exact options.
Procedure
- Select the exact device explicitly.
info reads version, serial, transport
capability masks, lock state, flags/timeouts, NFC restrictions, FIPS masks and
reset metadata. Retain unknown raw TLVs; reject malformed/duplicate records and
bound pagination. Do not infer all apps from a model or firmware version.
- On pre-4.1 firmware, report unavailable capability metadata explicitly and
only expose observed USB product/interface information. On 4.x, do not trust
the broken USB-enabled tag; 4.2.4 has a documented supported-mask correction.
- Application toggles and lock configuration require firmware 5.x plus observed
capabilities.
--enable/--disable may repeat. Unsupported apps, conflicting
options, disabling all USB apps and missing lock metadata fail before a write.
--list is read-only and cannot be combined with changes.
- Every write/reboot/reset requires literal
confirm: true. Lock material is
sixteen raw in-memory bytes via lock_code:/new_lock_code: or an explicit
secret_provider.call(field). Never guess a credential. Generation requires
secret_sink.call(:new_lock_code, bytes); never print the generated value.
- Write once, then read actual device information and compare requested fields.
Any lost acknowledgment, mismatching readback or identity change raises an
uncertainty error; never automatically resend. A lock flag verifies protection
state, not export/equality of the lock secret.
- USB interface changes normally reboot and need an explicit
reconnect
callable before writing. It receives nonsecret prior identity metadata and
must return a fresh handle to the exact device. The returned handle is closed
after readback; the original connection remains caller-owned. Never rediscover
or switch to the first available key. Serial-less reconnection must preserve
the same observed explicit selector; missing/changed selectors fail uncertain.
Use reboot: false only to intentionally
defer activation; stored configuration readback is not active-interface proof.
- Legacy NEO/4
mode emits the four-byte little-endian mode/timeouts record.
Reconnect after physical reinsertion and verify the observed USB product ID
maps to exactly the requested interfaces. A CCID reader that provides no USB
product ID cannot prove full legacy interface mode; fail uncertain rather than
claim success. Legacy timeout values are not readable and are labeled so.
- Full-device reset is gated by Bio multi-protocol/PIV or reset-blocked capability
metadata and smartcard transport, not assumed available on all YubiKeys. Verify
the fresh reset-state field is cleared.
data_erasure_verified: false is
explicit: configuration metadata does not independently prove forensic erasure
of every application credential. Use application-specific resets otherwise.
- NFC restriction is available from firmware 5.7 and lasts until USB power.
Disabling the currently used NFC path needs a separately usable readback path;
absence or lost connectivity is uncertainty, never verified completion.
Evidence boundaries
Same-path specs use synthetic HID/APDU/CTAP wire frames and the real shared
Protocol codec. They cover field packing, pagination, mutations/readback,
capability/version refusals, secrets, stale responses and legacy modes. No real
hardware, credential, network service or global reset is exercised by default.
Physical compatibility across firmware/models still requires explicit operator
hardware validation.
Protocol provenance: official yubikey-manager 5.9.1 source,
yubikit/management.py, yubikit/core/otp.py, ykman/_cli/config.py and
https://docs.yubico.com/yesdk/yubikey-api/Yubico.YubiKey.Management.Commands.html.
1---2name: pwn-plugins-yubikey-management3description: Configure native device capabilities with exact readback.4license: MIT5allowed-tools: [pwn, pwn_eval]6metadata:7 bundled: true8 preserve: true9 module: PWN::Plugins::YubiKey::Management10 source: https://skillmd.com/skills/0dayinc/pwn-plugins-yubikey-management11 upstream: pwn/plugins/yubikey/management.rb12---1314# PWN::Plugins::YubiKey::Management1516Native device information/configuration over OTP HID, management smartcard or17CTAP vendor commands. No executable, subprocess, interpreter or network backend.1819## API and routing2021`execute(args: [...], connection: ...)` takes argv after `config`.22`operations` lists five prior leaves: `usb`, `nfc`, `mode`, `set-lock-code`, `reset`.23Empty args return local metadata without device I/O. `--force` is not consent.24Typed APIs: `info`, `configure_usb`, `configure_nfc`, `set_mode`, `set_lock_code`,25`reset`, `reboot`, `help`, `authors`. See runtime help for exact options.2627## Procedure28291. Select the exact device explicitly. `info` reads version, serial, transport30 capability masks, lock state, flags/timeouts, NFC restrictions, FIPS masks and31 reset metadata. Retain unknown raw TLVs; reject malformed/duplicate records and32 bound pagination. Do not infer all apps from a model or firmware version.332. On pre-4.1 firmware, report unavailable capability metadata explicitly and34 only expose observed USB product/interface information. On 4.x, do not trust35 the broken USB-enabled tag; 4.2.4 has a documented supported-mask correction.363. Application toggles and lock configuration require firmware 5.x plus observed37 capabilities. `--enable`/`--disable` may repeat. Unsupported apps, conflicting38 options, disabling all USB apps and missing lock metadata fail before a write.39 `--list` is read-only and cannot be combined with changes.404. Every write/reboot/reset requires literal `confirm: true`. Lock material is41 sixteen raw in-memory bytes via `lock_code:`/`new_lock_code:` or an explicit42 `secret_provider.call(field)`. Never guess a credential. Generation requires43 `secret_sink.call(:new_lock_code, bytes)`; never print the generated value.445. Write once, then read actual device information and compare requested fields.45 Any lost acknowledgment, mismatching readback or identity change raises an46 uncertainty error; never automatically resend. A lock flag verifies protection47 state, not export/equality of the lock secret.486. USB interface changes normally reboot and need an explicit `reconnect`49 callable before writing. It receives nonsecret prior identity metadata and50 must return a fresh handle to the exact device. The returned handle is closed51 after readback; the original connection remains caller-owned. Never rediscover52 or switch to the first available key. Serial-less reconnection must preserve53 the same observed explicit selector; missing/changed selectors fail uncertain.54 Use `reboot: false` only to intentionally55 defer activation; stored configuration readback is not active-interface proof.567. Legacy NEO/4 `mode` emits the four-byte little-endian mode/timeouts record.57 Reconnect after physical reinsertion and verify the observed USB product ID58 maps to exactly the requested interfaces. A CCID reader that provides no USB59 product ID cannot prove full legacy interface mode; fail uncertain rather than60 claim success. Legacy timeout values are not readable and are labeled so.618. Full-device reset is gated by Bio multi-protocol/PIV or reset-blocked capability62 metadata and smartcard transport, not assumed available on all YubiKeys. Verify63 the fresh reset-state field is cleared. `data_erasure_verified: false` is64 explicit: configuration metadata does not independently prove forensic erasure65 of every application credential. Use application-specific resets otherwise.669. NFC restriction is available from firmware 5.7 and lasts until USB power.67 Disabling the currently used NFC path needs a separately usable readback path;68 absence or lost connectivity is uncertainty, never verified completion.6970## Evidence boundaries7172Same-path specs use synthetic HID/APDU/CTAP wire frames and the real shared73Protocol codec. They cover field packing, pagination, mutations/readback,74capability/version refusals, secrets, stale responses and legacy modes. No real75hardware, credential, network service or global reset is exercised by default.76Physical compatibility across firmware/models still requires explicit operator77hardware validation.7879Protocol provenance: official yubikey-manager **5.9.1** source,80`yubikit/management.py`, `yubikit/core/otp.py`, `ykman/_cli/config.py` and81<https://docs.yubico.com/yesdk/yubikey-api/Yubico.YubiKey.Management.Commands.html>.