Skip to content

Recover

A MIFARE Classic will not give up its contents without the keys to its sectors. RECOVER finds them, then dumps the card with them, in one run.

Everything below was done on a Classic 1K, UID 5AF70D9D, on a cabled Proxmark.

1 Choose
The ATTACK METHOD picker open with Key and Card Recovery, Darkside, Nested and Static Nested, each with a one line description
2 Checking
The output sheet headed Checking Keys reading Card detected Classic 1K, running fast key check with 61 hardcoded keys, estimated 4 to 10 seconds
3 Dumped
The output sheet headed Key Recovery Successful showing 1024 bytes saved to a binary file and a json file, and a note that the key and dump paths were auto-loaded
Pick the attack, leave the card on the reader, and the run ends with a dump on disk.
  1. Key and Card Recovery is first for a reason. Start here.
  2. Darkside, for an older card the key check did not open.
  3. Static Nested, for a hardened card whose nonce does not move.
  4. It names the card it found before it attacks it.
  5. 61 hardcoded keys, and an honest time estimate.
  6. Key Recovery Successful, with a green check.
  7. 1024 bytes written, as both .bin and .json.
  8. The paths are loaded into Write / Simulate for you.
  1. Put the Classic on the Proxmark antenna.
  2. Pick an ATTACK METHOD. Leave it on Key and Card Recovery unless you have a reason not to.
  3. Press START ATTACK.
  4. Leave the card still. The sheet says so, and it means it for the whole run, not just the key check.
  5. Key and Card Recovery ends in Key Recovery Successful and writes three files. The other three methods run a different attack and end in different sheets, listed further down.

Every sheet the app puts up while something is running carries a red CANCEL beside COPY ALL. The sheet at the end of the run carries CLOSE instead.

The app states what each one is for, and the order in the list is the order to try them in.

Attack MethodWhat the app saysWhen to pick itWhat the card has to be
Key and Card RecoveryCheck keys and dump card dataalways first. It tries known keys, and most cards in the field still carry onenothing. It exploits no weakness, it just tries keys
DarksideFast but only works on vulnerable cardsan older card the key check did not openvulnerable to Darkside. The app has no test for that and will not warn you either way
NestedWorks on cards with predictable PRNGthe card’s PRNG moved predictablypredictable PRNG
Static NestedFor cards with static noncesa hardened card, where the nonce does not move between authenticationsstatic nonce

Work down that table rather than starting at the bottom.

What Nested needs is a predictable PRNG, and the app says so twice. Before the run, when the hf mf info read reported otherwise, the output carries Warning: Card may not be vulnerable to Nested Attack. and Warning: PRNG is not predictable. Attack may fail. On a Fudan FM11RF08S it carries Warning: Card is not vulnerable to Nested Attack., Warning: This is an FM11RF08S card. Advanced scripted recovery requires a computer. and Warning: Continuing with selected method - may not succeed. instead. After a run that failed for that reason it carries Reason: Card PRNG is not predictable or card is not vulnerable. and Nested attacks require predictable PRNG or static nonce.

It runs anyway. The warnings do not stop it.

The run opens on a sheet titled Key Recovery reading Gathering card information..., then replaces it with one titled Checking Keys reading the same thing. The card is read with hf mf info twice, once behind each sheet, before any key is tried. Leaving the card still matters from the first sheet, not from the first key check.

Then four steps, and the app decides for itself how far down them it goes. --1k becomes --4k on a 4K card, read off that card information.

StepSheet titleCommandRuns when
1Checking Keyshf mf fchk --1k --dumpalways. 61 keys compiled into the app
2Checking Keys (Dictionary)hf mf fchk --1k -f mfc_default_keys.dic --dumpany sector came back with neither key A nor key B
3Checking Keys (Custom Dictionary)hf mf fchk --1k -f <your file> --no-default --dumpKey File Path is not empty
4Dumping Cardhf mf dump --1k --keys <key file>a key file name was recovered from the output, or could be built from the card’s UID

Step 2 is the escalation. The app counts a sector as open when either key A or key B came back found, and the moment one sector has neither it runs the whole check again against mfc_default_keys.dic, the dictionary bundled in the app. That file carries 5,928 keys against upstream’s 2,511.

Step 3 is not a fallback. It sits outside the step 2 decision, so a non-empty Key File Path adds a third pass even when step 1 already opened every sector.

These three never reach the four step run above. They take one command each, then a verification dump.

AttackCommand the app builds
Darksidehf mf darkside --1k
Nestedhf mf nested --1k --blk 0 -a -k <key>
Static Nestedhf mf staticnested --1k --blk 0 -a -k <key>

--blk 0 is added when the hf mf info read returned a UID. <key> is the key the app chose for itself, as described above.

The sheet while it runs is titled Key Recovery (<method name>) and carries the exact command, then whatever the read found, as a Fingerprint: line, a PRNG: line, a Static Nonce: Yes line, and the time estimate for that method and card size.

AttackClassic 1KClassic 4K
Darkside1 to 5 minutes3 to 10 minutes
Nested, weak or predictable PRNG1 to 3 minutes2 to 5 minutes
Nested, otherwise2 to 5 minutes5 to 15 minutes
Static Nested1 to 2 minutes2 to 4 minutes

When the attack recovers keys the sheet changes to Verifying Keys and the app runs hf mf dump --1k or hf mf dump --4k to read every sector back, then reports how many sectors read and which ones failed. When it recovers nothing, there is no verification and the run ends immediately.

It runs a fast dictionary of 61 hardcoded keys against every sector and reports a table, one row per sector:

Proxmark client proxmark3
[+]  000 | 003 | FFFFFFFFFFFF | 1 | FFFFFFFFFFFF | 1[+]  001 | 007 | 2A2C13CC242A | 1 | FFFFFFFFFFFF | 1[+]  002 | 011 | FFFFFFFFFFFF | 1 | FFFFFFFFFFFF | 1[+]  003 | 015 | ------------ | 0 | FFFFFFFFFFFF | 1
The key check output showing a table of sectors 000 to 006 with their trailer blocks, key A, a found flag, key B and a found flag, with sector 001 carrying a non default key A
The key table off the card. Sector 1 gave up a non default key, several sectors did not give up key A at all.
  1. Key Check Error in the header is the dump step, not the key check. The keys below were found.
  2. Sector, trailer block, then key A and key B each with a found flag.
  3. A non default key A the dictionary recovered.
  4. Dashes and a 0 are a key the dictionary did not have.

Sector, trailer block, key A and whether it was found, key B and whether it was found. 1 is found and 0 is not, and a row of dashes is a key the dictionary did not have.

On this card the dictionary found a non-default key A on sector 1, 2A2C13CC242A, and left key A unknown on the rest. Every sector still had one key, so the run went straight to the dump and printed All keys found with hardcoded keys. Skipping dictionary check.

Key File Path is an input, not just an output

Section titled “Key File Path is an input, not just an output”

Key File Path sits under the WRITE / SIM chip, in the section headed WRITE / DUMP CARD DATA, so it is off screen while RECOVER is selected. It still drives step 3 of the attack.

State of the fieldWhat the attack does
emptysteps 1, 2 and 4 only
a usable pathadds hf mf fchk --1k -f <that path> --no-default --dump as step 3. --no-default narrows that pass to your file, so none of the built in keys are retried in it
a path holding a space, a shell metacharacter or ..the run stops dead on a Key File Not Usable sheet reading The custom dictionary was NOT checked. Steps 1 and 2 have already run by then, so a key file is on disk and no dump is
The output sheet headed No Card Detected in red, listing checks for a MIFARE Classic on the reader, correct positioning and a still card, and a note that DESFire and Ultralight are not supported for key recovery
The refusal, and the sentence in it that defines the tab's scope.
  1. No Card Detected, in red, with a zoom control beside it.
  2. Three things to check, in the order worth checking them.
  3. The scope of the whole tab, in the app's own words.

The sheet lists the obvious checks, then adds the one that is not obvious:

Note: Some cards (DESFire, Ultralight, etc.) are not supported for key recovery.

If you are holding a DESFire or an Ultralight, nothing on this tab applies and no amount of repositioning will change that. See the Overview for what that means for a modern hospitality site.

The output sheet sizes its own text. On the way in it measures the widest line in the output against the width it has, and draws at the largest whole percentage that fits on one line, down to a floor of 50 percent. The readout beside the title reports that fitted figure rather than 100 percent.

The minus and the plus beside it override the fit. The first tap on either hands the size to you and the sheet stops recomputing it for the rest of that sheet’s life.

ControlWhat it does
minus and plus25 point steps, between 50 and 300 percent
the percentage between themthe size being drawn, fitted on open and yours after the first tap
COPY ALLthe full text, at any zoom
drag the handlethe sheet opens at half the screen and pulls up to the whole of it

The zoom controls are drawn only once a stage has finished. While a command is running the header carries the spinner and the title alone, and the bottom of the sheet carries COPY ALL and CANCEL.

Twelve sheets, and two of the green ones do not mean what they look like.

SheetMethodsWhat happened
Not Connectedall fourno Proxmark connected. Nothing ran
No Card DetectedKey and Card Recoverythe hf mf info read came back empty or without a UID, a SAK or a MIFARE line
Unsupported Card Typeall fourthe card is not a MIFARE Classic. The sheet quotes the read and suggests the client command for that card type
Key File Not UsableKey and Card RecoveryKey File Path holds a space, a shell metacharacter or ... Stopped before the dump
Canceledall fourCANCEL was pressed and the run reached its next checkpoint
Key Recovery SuccessfulKey and Card Recoverykeys checked and the card dumped. Green check, and it means it
Key Check CompleteKey and Card Recoverythe key checks ran, no key file name could be recovered or built, and the dump was skipped. Green check on a run with no dump
Key Check ErrorKey and Card Recoverythe run threw. Red, and the output above the error is still the real output
Attack SuccessfulDarkside, Nested, Static Nestedkeys recovered and read back by the verification dump
Keys RecoveredDarkside, Nested, Static Nestedkeys recovered, but the verification dump itself threw
Recovery CompleteDarkside, Nested, Static Nestedthe attack ran to the end and recovered nothing. Green check on an empty result
Recovery ErrorDarkside, Nested, Static Nestedthe run threw

CANCEL stops the command that is running, and the run then ends at its next checkpoint. On the Key and Card Recovery path those sit after each of the two card reads, after each key check pass, and after the dump, so a cancel costs you the rest of the stage you are in and no more.

Three files, named from the card’s UID, in the app’s own pm3/dump directory. Two commands write them.

FileWritten byWhat it is
hf-mf-<uid>-key.binthe key check, step 1, 2 or 3the keys the check recovered
hf-mf-<uid>-dump.binthe dump, step 4the card contents, 1024 bytes for a 1K
hf-mf-<uid>-dump.jsonthe dump, step 4the same contents with structure, readable without a hex editor

Those are first run names. The client refuses to overwrite a key file, so a second sweep over the same card lands on hf-mf-<uid>-key-001.bin, and a second dump on hf-mf-<uid>-dump-001.bin. The app reads the last name out of the output rather than the first, so the dump always authenticates with the keys from the pass that found the most.

A completed run ends by loading the dump path, the key path and the card’s UID into Write / Simulate, so the next step needs no file picking.