Documentation
¶
Overview ¶
Package wsc decodes Wi-Fi Simple Config (WSC / WPS) credential blobs — the TLV structure carried as the `application/vnd.wfa.wsc` MIME type.
This is the payload behind a "tap-to-connect" Wi-Fi NFC tag (an NDEF MIME record) and the Credential carried in WPS Registrar protocol messages (M7/M8). Decoding it recovers the provisioned network's SSID, authentication / encryption types, and — the operative field for a pentest — the network key (the PSK). PromptZero's ndef package surfaces such a record's MIME type but did not parse the payload; this fills that gap and is also exposed standalone (a WPS exchange carries the same blob outside NDEF).
Wrap-vs-native: native. The WSC attribute format is a flat sequence of big-endian (type:2, length:2, value) TLVs; the Credential attribute (0x100E) nests the same TLV grammar. No third-party dependency is warranted for fixed binary parsing. The attribute IDs and the authentication / encryption flag values are taken verbatim from the Wi-Fi Simple Config spec as published in hostap's src/wps/wps_defs.h (ATTR_* / WPS_AUTH_* / WPS_ENCR_*) — verified against that source, not recalled.
Covered: the Credential attribute and its standard sub-attributes (SSID, Authentication Type, Encryption Type, Network Key, MAC Address, Network Index), plus any top-level non-Credential attributes surfaced raw. Deferred: WSC Version 2 vendor-extension subelements (0x1049 WFA vendor extension) are surfaced raw (type + length), not interpreted — their internal subelement framing is vendor-specific; and the M7/M8 encrypted-settings attribute (0x1018) is AES-encrypted under a session key we do not have, so it is reported as present-but-encrypted rather than guessed at. No confidently-wrong output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
SSID string `json:"ssid,omitempty"`
SSIDHex string `json:"ssid_hex,omitempty"`
AuthTypeRaw uint16 `json:"auth_type_raw"`
AuthType []string `json:"auth_type,omitempty"`
EncrTypeRaw uint16 `json:"encr_type_raw"`
EncrType []string `json:"encr_type,omitempty"`
NetworkKey string `json:"network_key,omitempty"`
NetworkKeyHex string `json:"network_key_hex,omitempty"`
MACAddress string `json:"mac_address,omitempty"`
NetworkIndex *int `json:"network_index,omitempty"`
Notes []string `json:"notes,omitempty"`
}
Credential is one decoded WSC Credential attribute (a provisioned network). NetworkKey is the recovered PSK — the operative field.
type RawAttr ¶
type RawAttr struct {
Type string `json:"type"`
Length int `json:"length"`
Value string `json:"value_hex,omitempty"`
}
RawAttr is a top-level attribute that is not a Credential, surfaced without interpretation.