RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
4.08k stars 1.07k forks source link

HF field not activating for DESFire commands #1201

Closed VortixDev closed 3 years ago

VortixDev commented 3 years ago

Describe the bug The HF field is not being activated for transmission when running the hf mfdes createaid command, according to the warning (I can also replicate this with hf mfdes formatpicc, and have not tested others):

[usb] pm3 --> hf mfdes createaid -a 123456 -f 1111 -k 0E -l 2E --name Test
[=] Creating AID using:
[=] AID      563412
[=] Key set1 0x0E
[=] Key Set2 0x2E
[=] FID      1111
[=] DF Name  Test
[#] Warning: HF field is off, ignoring TransmitFor14443a command
[!!] 🚨 APDU: No APDU response.
[!] âš      Can't create aid ->

To Reproduce Run the example command for hf mfdes createaid (hf mfdes createaid -a 123456 -f 1111 -k 0E -l 2E --name Test).

Expected behavior The field should be activated prior to any attempt to transmit.

Additional information Using hf 14a raw -sk 00 to activate the field before running the hf mfdes createaid command leads to the command executing successfully. It should be noted that, although the field stays on after the hf 14a raw command is run, the command will still fail with "No APDU response" if the card is withdrawn from the field before hf mfdes createaid is ran (even if brought back into the field before executing), albeit without the "HF field is off" warning. A successful run is shown below.

[usb] pm3 --> hf mfdes createaid -a 123456 -f 1111 -k 0E -l 2E --name Test
[=] Creating AID using:
[=] AID      563412
[=] Key set1 0x0E
[=] Key Set2 0x2E
[=] FID      1111
[=] DF Name  Test
[#] Warning: HF field is off, ignoring TransmitFor14443a command
[!!] 🚨 APDU: No APDU response.
[!] âš      Can't create aid -> 
[usb] pm3 --> hf 14a raw -sk 00
[+] Card selected. UID[7]:
[+] 04 59 45 32 0B 4E 80 
[+] received 0 bytes
[usb] pm3 --> hf mfdes createaid -a 123456 -f 1111 -k 0E -l 2E --name Test
[=] Creating AID using:
[=] AID      563412
[=] Key set1 0x0E
[=] Key Set2 0x2E
[=] FID      1111
[=] DF Name  Test
[+] Successfully created aid.

Diagnostic information

(*) Q factor must be measured without tag on the antenna

[+] Displaying LF tuning graph. Divisor 88 (blue) is 134.83 kHz, 95 (red) is 125.00 kHz.

iceman1001 commented 3 years ago

That is the process for hf mfdes createaid . You need to authenticate first and the auth command turns on the field. Most desfire commands needs a auth first. So this is by design. Either we implement auth for each command, which means a messy command line, or we split it up and might suffer from ppl who forget they have the field on.

Its not super well documented the way that we operated the DESFire on a Pm3. Feel free to make a note / blogpost about it.

iceman1001 commented 3 years ago

I do mean that a note_on_desfire.md would be great.