From: iceman1001 Date: Wed, 24 Aug 2016 12:10:30 +0000 (+0200) Subject: CHG: added a verification to see if the found candidate key was able to validate... X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/760157f50bbb2c9b4f2ab01a74d76d062fc418ba CHG: added a verification to see if the found candidate key was able to validate against tag. If not ok, start darkside attack again. --- diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 65c9dcb7..c25ba32b 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -239,6 +239,17 @@ start: c.arg[0] = false; goto start; } else { + + // nonce2key found a candidate key. Lets verify it. + uint8_t keyblock[] = {0,0,0,0,0,0}; + num_to_bytes(r_key, 6, keyblock); + uint64_t key64 = 0; + int res = mfCheckKeys(blockNo, keytype - 0x60 , false, 1, keyblock, &key64); + if ( res > 0 ) { + PrintAndLog("Candidate Key found (%012"llx")", r_key); + PrintAndLog("Failing is expected to happen. Trying again ..."); + goto start; + } PrintAndLog("Found valid key: %012"llx" \n", r_key); } END: