draft for a Mifare classic NACK bug detection.

the idea is to have a statistically solid conclusion if tag does or does not have the NACK bug.

-in short, ref  https://github.com/iceman1001/proxmark3/issues/141
NACK bug;  when a tag responds with a NACK to a 8 byte nonce exchange during authentication when the bytes are wrong but the parity bits are correct.

This is a strong oracle which is used in the darkside attack.
This commit is contained in:
iceman1001 2017-12-04 19:36:26 +01:00
commit e02e145fae
6 changed files with 281 additions and 14 deletions

View file

@ -881,21 +881,18 @@ void UsbPacketReceived(uint8_t *packet, int len) {
case CMD_MIFARE_CIDENT:
MifareCIdent();
break;
// mifare sniffer
case CMD_MIFARE_SNIFFER:
SniffMifare(c->arg[0]);
break;
case CMD_MIFARE_SETMOD:
MifareSetMod(c->arg[0], c->d.asBytes);
break;
//mifare desfire
case CMD_MIFARE_DESFIRE_READBL:
break;
case CMD_MIFARE_DESFIRE_WRITEBL:
break;
case CMD_MIFARE_DESFIRE_READBL:
break;
case CMD_MIFARE_DESFIRE_WRITEBL:
break;
case CMD_MIFARE_DESFIRE_AUTH1:
MifareDES_Auth1(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
@ -913,6 +910,9 @@ void UsbPacketReceived(uint8_t *packet, int len) {
break;
case CMD_MIFARE_COLLECT_NONCES:
break;
case CMD_MIFARE_NACK_DETECT:
DetectNACKbug();
break;
#endif
#ifdef WITH_ICLASS