mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 13:00:42 -07:00
ADD: 'hf standalone 14a mode", added "mifare 4k" detection.
ADD: 'hf 14a sim' - added mifare 4k simulation.
This commit is contained in:
parent
507afbf3e6
commit
4401050bcc
3 changed files with 21 additions and 12 deletions
|
@ -596,21 +596,25 @@ void StandAloneMode14a()
|
||||||
Dbprintf("Simulating ISO14443a tag with uid: %08x [Bank: %u]", tmpuid & 0xFFFFFFFF , selected);
|
Dbprintf("Simulating ISO14443a tag with uid: %08x [Bank: %u]", tmpuid & 0xFFFFFFFF , selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uids[selected].sak == 8 && uids[selected].atqa[0] == 4 && uids[selected].atqa[1] == 0) {
|
if (uids[selected].sak == 0x08 && uids[selected].atqa[0] == 0x04 && uids[selected].atqa[1] == 0) {
|
||||||
DbpString("Mifare Classic");
|
DbpString("Mifare Classic 1k");
|
||||||
SimulateIso14443aTag(1, flags, data); // Mifare Classic
|
SimulateIso14443aTag(1, flags, data);
|
||||||
}
|
} else if (uids[selected].sak == 0x18 && uids[selected].atqa[0] == 0x02 && uids[selected].atqa[1] == 0) {
|
||||||
else if (uids[selected].sak == 0 && uids[selected].atqa[0] == 0x44 && uids[selected].atqa[1] == 0) {
|
DbpString("Mifare Classic 4k (4b uid)");
|
||||||
|
SimulateIso14443aTag(8, flags, data);
|
||||||
|
} else if (uids[selected].sak == 0x08 && uids[selected].atqa[0] == 0x44 && uids[selected].atqa[1] == 0) {
|
||||||
|
DbpString("Mifare Classic 4k (7b uid)");
|
||||||
|
SimulateIso14443aTag(8, flags, data);
|
||||||
|
} else if (uids[selected].sak == 0x00 && uids[selected].atqa[0] == 0x44 && uids[selected].atqa[1] == 0) {
|
||||||
DbpString("Mifare Ultralight");
|
DbpString("Mifare Ultralight");
|
||||||
SimulateIso14443aTag(2, flags, data); // Mifare Ultralight
|
SimulateIso14443aTag(2, flags, data);
|
||||||
}
|
} else if (uids[selected].sak == 0x20 && uids[selected].atqa[0] == 0x04 && uids[selected].atqa[1] == 0x03) {
|
||||||
else if (uids[selected].sak == 20 && uids[selected].atqa[0] == 0x44 && uids[selected].atqa[1] == 3) {
|
|
||||||
DbpString("Mifare DESFire");
|
DbpString("Mifare DESFire");
|
||||||
SimulateIso14443aTag(3, flags, data); // Mifare DESFire
|
SimulateIso14443aTag(3, flags, data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Dbprintf("Unrecognized tag type -- defaulting to Mifare Classic emulation");
|
Dbprintf("Unrecognized tag type -- defaulting to Mifare Classic emulation");
|
||||||
SimulateIso14443aTag(1, flags, data); // Mifare Classic
|
SimulateIso14443aTag(1, flags, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (button_action == BUTTON_SINGLE_CLICK) {
|
else if (button_action == BUTTON_SINGLE_CLICK) {
|
||||||
|
|
|
@ -918,7 +918,11 @@ void SimulateIso14443aTag(int tagType, int flags, byte_t* data) {
|
||||||
memcpy(data+3, emdata+4, 4); // uid bytes 3-7
|
memcpy(data+3, emdata+4, 4); // uid bytes 3-7
|
||||||
flags |= FLAG_7B_UID_IN_DATA;
|
flags |= FLAG_7B_UID_IN_DATA;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case 8: { // MIFARE Classic 4k
|
||||||
|
response1[0] = 0x02;
|
||||||
|
sak = 0x18;
|
||||||
|
} break;
|
||||||
default: {
|
default: {
|
||||||
Dbprintf("Error: unkown tagtype (%d)",tagType);
|
Dbprintf("Error: unkown tagtype (%d)",tagType);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -133,13 +133,14 @@ int usage_hf_14a_sim(void) {
|
||||||
PrintAndLog("usage: hf 14a sim [h] t <type> u <uid> [x] [e] [v]");
|
PrintAndLog("usage: hf 14a sim [h] t <type> u <uid> [x] [e] [v]");
|
||||||
PrintAndLog("options: ");
|
PrintAndLog("options: ");
|
||||||
PrintAndLog(" h : This help");
|
PrintAndLog(" h : This help");
|
||||||
PrintAndLog(" t : 1 = MIFARE Classic");
|
PrintAndLog(" t : 1 = MIFARE Classic 1k");
|
||||||
PrintAndLog(" 2 = MIFARE Ultralight");
|
PrintAndLog(" 2 = MIFARE Ultralight");
|
||||||
PrintAndLog(" 3 = MIFARE Desfire");
|
PrintAndLog(" 3 = MIFARE Desfire");
|
||||||
PrintAndLog(" 4 = ISO/IEC 14443-4");
|
PrintAndLog(" 4 = ISO/IEC 14443-4");
|
||||||
PrintAndLog(" 5 = MIFARE Tnp3xxx");
|
PrintAndLog(" 5 = MIFARE Tnp3xxx");
|
||||||
PrintAndLog(" 6 = MIFARE Mini");
|
PrintAndLog(" 6 = MIFARE Mini");
|
||||||
PrintAndLog(" 7 = AMIIBO (NTAG 215), pack 0x8080");
|
PrintAndLog(" 7 = AMIIBO (NTAG 215), pack 0x8080");
|
||||||
|
PrintAndLog(" 8 = MIFARE Classic 4k");
|
||||||
// PrintAndLog(" u : 4, 7 or 10 byte UID");
|
// PrintAndLog(" u : 4, 7 or 10 byte UID");
|
||||||
PrintAndLog(" u : 4, 7 byte UID");
|
PrintAndLog(" u : 4, 7 byte UID");
|
||||||
PrintAndLog(" x : (Optional) Performs the 'reader attack', nr/ar attack against a reader");
|
PrintAndLog(" x : (Optional) Performs the 'reader attack', nr/ar attack against a reader");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue