mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Fix MFC static nonce detection on some cards and do it before prng det
This commit is contained in:
parent
55e800e4ce
commit
e488ef306c
2 changed files with 15 additions and 12 deletions
|
@ -2383,6 +2383,9 @@ void MifareHasStaticNonce(void) {
|
||||||
|
|
||||||
nt = bytes_to_num(rec, 4);
|
nt = bytes_to_num(rec, 4);
|
||||||
|
|
||||||
|
// some cards with static nonce need to be reset before next query
|
||||||
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||||
|
LEDsoff();
|
||||||
CHK_TIMEOUT();
|
CHK_TIMEOUT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1956,7 +1956,13 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
isMagic = detect_classic_magic();
|
isMagic = detect_classic_magic();
|
||||||
|
|
||||||
if (isMifareClassic) {
|
if (isMifareClassic) {
|
||||||
int res = detect_classic_prng();
|
int res = detect_classic_static_nonce();
|
||||||
|
if (res == 1)
|
||||||
|
PrintAndLogEx(SUCCESS, "Static nonce: " _YELLOW_("yes"));
|
||||||
|
if (res == 2 && verbose)
|
||||||
|
PrintAndLogEx(SUCCESS, "Static nonce: " _RED_("fail"));
|
||||||
|
if (res != 1) { // not static
|
||||||
|
res = detect_classic_prng();
|
||||||
if (res == 1)
|
if (res == 1)
|
||||||
PrintAndLogEx(SUCCESS, "Prng detection: " _GREEN_("weak"));
|
PrintAndLogEx(SUCCESS, "Prng detection: " _GREEN_("weak"));
|
||||||
else if (res == 0)
|
else if (res == 0)
|
||||||
|
@ -1966,13 +1972,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
|
|
||||||
if (do_nack_test)
|
if (do_nack_test)
|
||||||
detect_classic_nackbug(false);
|
detect_classic_nackbug(false);
|
||||||
|
}
|
||||||
res = detect_classic_static_nonce();
|
|
||||||
if (res == 1)
|
|
||||||
PrintAndLogEx(SUCCESS, "Static nonce: " _YELLOW_("yes"));
|
|
||||||
if (res == 2 && verbose)
|
|
||||||
PrintAndLogEx(SUCCESS, "Static nonce: " _RED_("fail"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue