diff --git a/src/mfoc.c b/src/mfoc.c index e2545be..18d7890 100644 --- a/src/mfoc.c +++ b/src/mfoc.c @@ -96,17 +96,17 @@ int main(int argc, char *const argv[]) uint8_t defaultKeys[][6] = { {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // Default key (first key used by program if no user defined key) {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5}, // NFCForum MAD key - {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}, // NFCForum content key - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Blank key - {0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5}, - {0x4d, 0x3a, 0x99, 0xc3, 0x51, 0xdd}, - {0x1a, 0x98, 0x2c, 0x7e, 0x45, 0x9a}, - {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, - {0x71, 0x4c, 0x5c, 0x88, 0x6e, 0x97}, - {0x58, 0x7e, 0xe5, 0xf9, 0x35, 0x0f}, - {0xa0, 0x47, 0x8c, 0xc3, 0x90, 0x91}, - {0x53, 0x3c, 0xb6, 0xc7, 0x23, 0xf6}, - {0x8f, 0xd0, 0xa4, 0xf2, 0x56, 0xe9} +// {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}, // NFCForum content key +// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Blank key +// {0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5}, +// {0x4d, 0x3a, 0x99, 0xc3, 0x51, 0xdd}, +// {0x1a, 0x98, 0x2c, 0x7e, 0x45, 0x9a}, +// {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, +// {0x71, 0x4c, 0x5c, 0x88, 0x6e, 0x97}, +// {0x58, 0x7e, 0xe5, 0xf9, 0x35, 0x0f}, +// {0xa0, 0x47, 0x8c, 0xc3, 0x90, 0x91}, +// {0x53, 0x3c, 0xb6, 0xc7, 0x23, 0xf6}, +// {0x8f, 0xd0, 0xa4, 0xf2, 0x56, 0xe9} }; @@ -143,7 +143,8 @@ int main(int argc, char *const argv[]) switch (ch) { case 'P': // Number of probes - if (!(probes = atoi(optarg)) || probes < 1) { + probes = atoi(optarg); + if (probes < 0) { ERR("The number of probes must be a positive number"); exit(EXIT_FAILURE); } @@ -1059,7 +1060,7 @@ int mf_enhanced_auth(int e_sector, int a_sector, mftag t, mfreader r, denonce *d NtLast = bytes_to_num(Rx, 4) ^ crypto1_word(pcs, bytes_to_num(Rx, 4) ^ t.authuid, 1); // Make sure the card is using the known PRNG - if (! validate_prng_nonce(NtLast)) { + if (true || ! validate_prng_nonce(NtLast)) { printf("Card is not vulnerable to nested attack\n"); return -99999; } diff --git a/src/mfoc.h b/src/mfoc.h index 9ea7547..8ee064b 100644 --- a/src/mfoc.h +++ b/src/mfoc.h @@ -30,7 +30,7 @@ #define DEFAULT_DIST_NR 15 // Default number of probes for a key recovery for one sector -#define DEFAULT_PROBES_NR 150 +#define DEFAULT_PROBES_NR 1 // Number of sets with 32b keys #define DEFAULT_SETS_NR 5