Oath

From 0dayInc/pwn · View interactive version

Oath is an AI agent skill from the GitHub repository 0dayInc/pwn. Use native OATH with exact account identities.

How to use this skill

Skill file

Native OATH

When to use

Use PWN::Plugins::YubiKey::OATH for OATH application APDUs, not software-only OTP

or browser WebAuthn. The root YubiKey router owns transport lifetime.

Public API

remember, forget, and accounts add, uri, import, list, code,

rename, delete. Empty/group args return local metadata.

raw full HMAC, not a formatted OTP.

records with code value/validity Hashes; HOTP and touch records have nil codes.

Procedure

  1. Use a caller-selected APDU connection. Never select the first device implicitly.
  2. Pass the exact complete ID returned by LIST, including period/issuer prefixes,

whitespace and UTF-8 bytes. No substring, case folding or Unicode normalization

is performed when identifying an account.

  1. Use code for one numeric OTP String; leading zeroes are significant. Optional

timestamp: is nonnegative Integer epoch seconds. TOTP periods come from the

credential ID, while HOTP uses an empty challenge and increments its counter.

  1. Supply password: or sixteen raw bytes in access_key: in memory, or an

explicit secret_provider: callback. Authentication is single-attempt with

mutual HMAC-SHA1 verification after SELECT. Missing or wrong credentials never

trigger default guesses, repair, cached-key deletion, fallback or retry.

  1. For account creation supply secret: (raw bytes) or strict secret_base32:;

--generate returns the generated seed in memory. Metadata options include

oath-type, algorithm (SHA1/SHA256/SHA512), digits (6–8), period, issuer, initial

HOTP counter and touch. Invalid values fail before authentication. Existing

IDs require explicit overwrite: true or --force in addition to consent.

  1. URI input goes in uri:, not argv. Conflicting issuer fields, noncanonical

Base32, duplicate URI parameters and invalid periods are rejected, not repaired.

  1. Bulk import accepts credentials: (complete Hash records) or pskc: (in-memory

PSKC 1.0 XML). Validate the complete batch before any authentication/write;

never silently skip a bad entry. Each successful PUT is checked with LIST.

Partial device failure is not rolled back or retried.

  1. Use access change with new_password: / new_access_key:, or --clear.

Changes read back protection state only, not secret contents. Reset uses DEAD

confirmation bytes and verifies regenerated salt, unlocked state and empty

inventory. Rename/delete verify exact IDs and never delete as a repair step.

Explicit encrypted-cache handoff

There is no built-in host cache or implicit lookup. access remember, --remember

and use_cache: true require an explicit encrypted_cache: adapter supplied by

the caller. It must expose encrypted? == true and these methods:

cache.store(device_id: id, access_key: raw_key)
cache.fetch(device_id: id) # raw bytes or nil
cache.delete(device_id: id)
# access forget --all additionally requires:
cache.clear
cache.empty?

The adapter owns encryption-at-rest and unlock policy; the assertion is the

caller's contract, not a cryptographic audit by this module. This is a transfer to

an explicit encrypted storage API, not a plaintext file store. Mutations are

read back through the adapter. Stored keys are never deleted after failed auth,

or automatically removed on password change/reset; explicitly forget stale

records. use_cache: never falls back to a password after failure. Do not supply

a plaintext Hash/file adapter in production.

Pitfalls and limits

writes. --force does not supply confirmation. Unprotected inventory is read-only.

MAC-authenticated AES-CBC, raw pskc_key: or embedded PBKDF2 with

pskc_password:. Unsupported algorithms, XML signatures and DTD/entities are

rejected. PSKC export-on-add, legacy file-path argv, arbitrary XML encryption

algorithms and Steam-specific five-character output are not implemented.

flags do not change the structured result. Exact numeric MFA does not silently

switch to Steam formatting.

overwrite defects fail closed. FIPS policy is ultimately enforced by the

selected application; no host override or plaintext secure-channel fallback exists.

access exists. Ruby does not guarantee memory zeroization.

proof of the imported secret. Timeouts leave mutation state uncertain.

Verification

Run bundle exec rspec spec/lib/pwn/plugins/yubikey/oath_spec.rb and scoped

RuboCop. Tests exercise production Protocol framing and a raw exchange boundary,

including application-specific A5 SEND REMAINING, mutual auth, RFC 6238 vectors,

strict identities, mutation readback, cache handoff, and authenticated PSKC import.

No real hardware, home credentials or network is accessed.

References: Yubico YKOATH protocol and pinned yubikey-manager 5.9.1

yubikit/oath.py / ykman/_cli/oath.py; RFC 4226, RFC 6238, RFC 6030 and RFC 3394.

https://developers.yubico.com/OATH/YKOATH_Protocol.html

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.