CoAP block-wise transfer
Traffic between low-power IoT nodes and the central CoAP server (10.40.10.1:5683/UDP) was recorded: coap.pcap.
On the network, two clients are downloading configurations in parallel using the CoAP Block2 (RFC 7959) mechanism: one is downloading a test resource (GET /fw/sandbox) and the other the real firmware configuration (GET /fw/config). In the CoAP protocol, response packets (2.05 Content, code 0x45) do not carry the URI again — they are tied to the request by the Token bytes.
CoAP options are delta-encoded: Uri-Path (option 11), Content-Format (option 12) and Block2 (option 23). The whole value of the Block2 option has the form (NUM << 4) | (M << 3) | SZX, where NUM is the block sequence number (starting from 0), M is the more-blocks flag, and SZX is the block size (2^(SZX+4) bytes). After the options come the 0xFF payload marker and the block data.
Note that in the /fw/config transfer the blocks were requested out of order and some packets were re-sent (duplicate Message ID). Identify the correct token, join the blocks in NUM order, base64-decode the "secret" field inside the resulting JSON and find BAYROQ{...}. (Flag format: BAYROQ{COAP_BLOK_<16 kichik hex>}).