diff --git a/traces/README.md b/traces/README.md index 26f1160de..94d281774 100644 --- a/traces/README.md +++ b/traces/README.md @@ -131,3 +131,52 @@ mode, so the files differ mainly in that one byte. |lf_ht2_publicA.bin |Hitag2 in Public Mode A (config `0x02`), Manchester, pages 4-5, carries an EM4102 payload| |lf_ht2_publicB.bin |Hitag2 in Public Mode B (config `0x00`), biphase 32 T0, pages 4-7| |lf_ht2_publicC.bin |Hitag2 in Public Mode C (config `0x04`), biphase 64 T0, pages 4-7| + +## MIFARE DESFire card images + +Card images for `hf mfdes eload`, used by `hf mfdes sim`. All three are in the +`mfdes v1` dump format documented in `doc/mfdes_dump_format.md`. + +The 8K images come off a genuine MIFARE DESFire EV1 8K, UID `04268512A25680`, +batch `B9 0C 17 49 70`, week 27 / 2017, hardware `04010101001A05`, software +`04010101041A05`. + +|filename|description| +|--------|-----------| +|hf-mfdes-ev1-8k-empty.json |EV1 8K straight after `formatpicc`. PICC only, default 2TDEA key, 7936 bytes free| +|hf-mfdes-ev1-4k-empty.json |The same image edited to present as an EV1 4K. **Derived, not dumped from 4K silicon** -- the storage size byte of `VersionHW`/`VersionSW` is changed from `0x1A` to `0x18`, and `FreeMem` set to 3840, the nominal 4096 minus the 256 bytes of overhead the 8K part shows| +|hf-mfdes-ev1-8k-test.json |The same card with three applications and all five EV1 file types, for exercising a simulation| +|hf-mfdes-ev1-8k-test-keys.json |Application keys for the above, in the `mfdes v2` format `hf mfdes chk -j` writes| +|hf-mfdes-ev1-8k-empty-keys.json|Key file for the empty 8K image. Empty by construction, a blank card has no applications| +|hf-mfdes-ev1-4k-empty-keys.json|Key file for the empty 4K image. Likewise empty| + +### Keys + +Every key on this card is the default all-zero one. The PICC master key is +2TDEA `00000000000000000000000000000000`; each application uses its own +algorithm, and all of its keys are that algorithm's all-zero key. + +The `mfdes v2` key files carry **application** keys only -- that format has no +place for the PICC master key, because `hf mfdes chk` only walks the application +list and takes the PICC key from `-k`. Hand it in explicitly: + +``` +hf mfdes dump -n 0 -t 2TDEA -k 00000000000000000000000000000000 --keys traces/mifare/hf-mfdes-ev1-8k-test-keys.json +``` + +Note that every key is also stored inside the dump itself, under each +application's `Keys` object, so `eload` and `sim` need no key file at all -- +the key files are for reading or rebuilding the physical card. + +`hf-mfdes-ev1-8k-test.json` holds: + +|AID|keys|ISO DF name|files| +|---|----|-----------|-----| +|`010203`|AES, 3 |`test1`|`01` standard 256 B free access, `02` backup 128 B MAC mode, rights `1200`| +|`112233`|2TDEA, 2 |`test2`|`00` value, 1000 with limits [0..10000], `01` linear record, 2 of 8 records, 16 B each| +|`AABBCC`|3TDEA, 5 |`test3`|`05` cyclic record, 1 of 4 records, 24 B each, `03` standard 64 B free access| + +``` +hf mfdes eload -f traces/mifare/hf-mfdes-ev1-8k-test.json +hf mfdes sim +``` diff --git a/traces/mifare/hf-mfdes-ev1-4k-empty-keys.json b/traces/mifare/hf-mfdes-ev1-4k-empty-keys.json new file mode 100644 index 000000000..f18fbe887 --- /dev/null +++ b/traces/mifare/hf-mfdes-ev1-4k-empty-keys.json @@ -0,0 +1,11 @@ +{ + "Created": "proxmark3", + "FileType": "mfdes v2", + "Card": { + "UID": "04268512A25680", + "SAK": "20", + "ATQA": "4403", + "ATS": "06757781028002F0" + }, + "Applications": {} +} diff --git a/traces/mifare/hf-mfdes-ev1-4k-empty.json b/traces/mifare/hf-mfdes-ev1-4k-empty.json new file mode 100644 index 000000000..73b7023d7 --- /dev/null +++ b/traces/mifare/hf-mfdes-ev1-4k-empty.json @@ -0,0 +1,30 @@ +{ + "Created": "proxmark3", + "FileType": "mfdes v1", + "Version": 1, + "Card": { + "UID": "04268512A25680", + "ATQA": "4403", + "SAK": "20", + "ATS": "06757781028002F0", + "VersionHW": "04010101001805", + "VersionSW": "04010101041805", + "VersionProd": "04268512A25680B90C1749702717", + "FreeMem": 3840 + }, + "Applications": { + "000000": { + "KeySettings": "0F", + "NumKeysRaw": "01", + "NumKeys": 1, + "KeyType": "2tdea", + "Authenticated": true, + "Keys": { + "0": { + "Version": "00", + "Key": "00000000000000000000000000000000" + } + } + } + } +} diff --git a/traces/mifare/hf-mfdes-ev1-8k-empty-keys.json b/traces/mifare/hf-mfdes-ev1-8k-empty-keys.json new file mode 100644 index 000000000..f18fbe887 --- /dev/null +++ b/traces/mifare/hf-mfdes-ev1-8k-empty-keys.json @@ -0,0 +1,11 @@ +{ + "Created": "proxmark3", + "FileType": "mfdes v2", + "Card": { + "UID": "04268512A25680", + "SAK": "20", + "ATQA": "4403", + "ATS": "06757781028002F0" + }, + "Applications": {} +} diff --git a/traces/mifare/hf-mfdes-ev1-8k-empty.json b/traces/mifare/hf-mfdes-ev1-8k-empty.json new file mode 100644 index 000000000..887fe7dca --- /dev/null +++ b/traces/mifare/hf-mfdes-ev1-8k-empty.json @@ -0,0 +1,30 @@ +{ + "Created": "proxmark3", + "FileType": "mfdes v1", + "Version": 1, + "Card": { + "UID": "04268512A25680", + "ATQA": "4403", + "SAK": "20", + "ATS": "06757781028002F0", + "VersionHW": "04010101001A05", + "VersionSW": "04010101041A05", + "VersionProd": "04268512A25680B90C1749702717", + "FreeMem": 7936 + }, + "Applications": { + "000000": { + "KeySettings": "0F", + "NumKeysRaw": "01", + "NumKeys": 1, + "KeyType": "2tdea", + "Authenticated": true, + "Keys": { + "0": { + "Version": "00", + "Key": "00000000000000000000000000000000" + } + } + } + } +} \ No newline at end of file diff --git a/traces/mifare/hf-mfdes-ev1-8k-test-keys.json b/traces/mifare/hf-mfdes-ev1-8k-test-keys.json new file mode 100644 index 000000000..008b39e39 --- /dev/null +++ b/traces/mifare/hf-mfdes-ev1-8k-test-keys.json @@ -0,0 +1,34 @@ +{ + "Created": "proxmark3", + "FileType": "mfdes v2", + "Card": { + "UID": "04268512A25680", + "SAK": "20", + "ATQA": "4403", + "ATS": "06757781028002F0" + }, + "Applications": { + "010203": { + "AES": { + "0": { "Key": "00000000000000000000000000000000" }, + "1": { "Key": "00000000000000000000000000000000" }, + "2": { "Key": "00000000000000000000000000000000" } + } + }, + "112233": { + "2TDEA": { + "0": { "Key": "00000000000000000000000000000000" }, + "1": { "Key": "00000000000000000000000000000000" } + } + }, + "AABBCC": { + "3TDEA": { + "0": { "Key": "000000000000000000000000000000000000000000000000" }, + "1": { "Key": "000000000000000000000000000000000000000000000000" }, + "2": { "Key": "000000000000000000000000000000000000000000000000" }, + "3": { "Key": "000000000000000000000000000000000000000000000000" }, + "4": { "Key": "000000000000000000000000000000000000000000000000" } + } + } + } +} diff --git a/traces/mifare/hf-mfdes-ev1-8k-test.json b/traces/mifare/hf-mfdes-ev1-8k-test.json new file mode 100644 index 000000000..dd35ec486 --- /dev/null +++ b/traces/mifare/hf-mfdes-ev1-8k-test.json @@ -0,0 +1,172 @@ +{ + "Created": "proxmark3", + "FileType": "mfdes v1", + "Version": 1, + "Card": { + "UID": "04268512A25680", + "ATQA": "4403", + "SAK": "20", + "ATS": "06757781028002F0", + "VersionHW": "04010101001A05", + "VersionSW": "04010101041A05", + "VersionProd": "04268512A25680B90C1749702717", + "FreeMem": 6400 + }, + "Applications": { + "000000": { + "KeySettings": "0F", + "NumKeysRaw": "01", + "NumKeys": 1, + "KeyType": "2tdea", + "Authenticated": true, + "Keys": { + "0": { + "Version": "00", + "Key": "00000000000000000000000000000000" + } + } + }, + "010203": { + "ISOFileID": "1234", + "DFName": "7465737431", + "KeySettings": "0B", + "NumKeysRaw": "83", + "NumKeys": 3, + "KeyType": "aes", + "Authenticated": true, + "Keys": { + "0": { + "Version": "00", + "Key": "00000000000000000000000000000000" + }, + "1": { + "Version": "00" + }, + "2": { + "Version": "00" + } + }, + "Files": { + "01": { + "Type": "standard", + "TypeRaw": "00", + "CommMode": "plain", + "AccessRights": "EEEE", + "ISOFileID": "0001", + "FileSize": 256, + "Read": true, + "Data": "50726F786D61726B3320444553466972652045563120384B20746573742063617264000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "02": { + "Type": "backup", + "TypeRaw": "01", + "CommMode": "mac", + "AccessRights": "1200", + "ISOFileID": "0002", + "FileSize": 128, + "Read": true, + "Data": "6261636B75702066696C6520636F6E74656E7400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "112233": { + "ISOFileID": "2345", + "DFName": "7465737432", + "KeySettings": "0B", + "NumKeysRaw": "02", + "NumKeys": 2, + "KeyType": "2tdea", + "Authenticated": true, + "Keys": { + "0": { + "Version": "00", + "Key": "00000000000000000000000000000000" + }, + "1": { + "Version": "00" + } + }, + "Files": { + "00": { + "Type": "value", + "TypeRaw": "02", + "CommMode": "plain", + "AccessRights": "EE00", + "LowerLimit": 0, + "UpperLimit": 10000, + "LimitedCredit": "00", + "Value": 1000, + "Read": true + }, + "01": { + "Type": "linear_record", + "TypeRaw": "03", + "CommMode": "plain", + "AccessRights": "EE00", + "ISOFileID": "0011", + "RecordSize": 16, + "MaxRecords": 8, + "CurRecords": 2, + "Read": true, + "Records": { + "0": "6C696E65617220726563202330310000", + "1": "6C696E65617220726563202330320000" + } + } + } + }, + "AABBCC": { + "ISOFileID": "3456", + "DFName": "7465737433", + "KeySettings": "0B", + "NumKeysRaw": "45", + "NumKeys": 5, + "KeyType": "3tdea", + "Authenticated": true, + "Keys": { + "0": { + "Version": "00", + "Key": "000000000000000000000000000000000000000000000000" + }, + "1": { + "Version": "00" + }, + "2": { + "Version": "00" + }, + "3": { + "Version": "00" + }, + "4": { + "Version": "00" + } + }, + "Files": { + "05": { + "Type": "cyclic_record", + "TypeRaw": "04", + "CommMode": "plain", + "AccessRights": "EE00", + "ISOFileID": "0055", + "RecordSize": 24, + "MaxRecords": 4, + "CurRecords": 1, + "Read": true, + "Records": { + "0": "6379636C6963207265636F72642023310000000000000000" + } + }, + "03": { + "Type": "standard", + "TypeRaw": "00", + "CommMode": "plain", + "AccessRights": "EEEE", + "ISOFileID": "0033", + "FileSize": 64, + "Read": true, + "Data": "667265652072656164207374642066696C6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + } + } + } +} \ No newline at end of file