mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
hf mf sim -x: collect nonces for mfkey32v2 only if current sim key is invalid
This commit is contained in:
parent
809b6c881a
commit
8828c9513e
1 changed files with 42 additions and 43 deletions
|
@ -1141,6 +1141,12 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
|
||||||
nr = bytes_to_num(receivedCmd, 4);
|
nr = bytes_to_num(receivedCmd, 4);
|
||||||
ar = bytes_to_num(&receivedCmd[4], 4);
|
ar = bytes_to_num(&receivedCmd[4], 4);
|
||||||
|
|
||||||
|
// --- crypto
|
||||||
|
crypto1_word(pcs, nr, 1);
|
||||||
|
cardRr = ar ^ crypto1_word(pcs, 0, 0);
|
||||||
|
|
||||||
|
// test if auth KO
|
||||||
|
if (cardRr != prng_successor(nonce, 64)) {
|
||||||
// Collect AR/NR per keytype & sector
|
// Collect AR/NR per keytype & sector
|
||||||
if ((flags & FLAG_NR_AR_ATTACK) == FLAG_NR_AR_ATTACK) {
|
if ((flags & FLAG_NR_AR_ATTACK) == FLAG_NR_AR_ATTACK) {
|
||||||
|
|
||||||
|
@ -1183,13 +1189,6 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- crypto
|
|
||||||
crypto1_word(pcs, nr, 1);
|
|
||||||
cardRr = ar ^ crypto1_word(pcs, 0, 0);
|
|
||||||
|
|
||||||
// test if auth KO
|
|
||||||
if (cardRr != prng_successor(nonce, 64)) {
|
|
||||||
if (g_dbglevel >= DBG_EXTENDED) {
|
if (g_dbglevel >= DBG_EXTENDED) {
|
||||||
Dbprintf("[MFEMUL_AUTH1] AUTH FAILED for sector %d with key %c. [nr=%08x cardRr=%08x] [nt=%08x succ=%08x]"
|
Dbprintf("[MFEMUL_AUTH1] AUTH FAILED for sector %d with key %c. [nr=%08x cardRr=%08x] [nt=%08x succ=%08x]"
|
||||||
, cardAUTHSC
|
, cardAUTHSC
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue