mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 07:05:40 -07:00
add auto select channel to lrp
This commit is contained in:
parent
d716971430
commit
46f2defcd3
1 changed files with 13 additions and 4 deletions
|
@ -1320,7 +1320,8 @@ static int CmdHF14aDesDetect(const char *Cmd) {
|
||||||
"hf mfdes detect -> detect key 0 from PICC level\n"
|
"hf mfdes detect -> detect key 0 from PICC level\n"
|
||||||
"hf mfdes detect -s d40 -> detect key 0 from PICC level via secure channel D40\n"
|
"hf mfdes detect -s d40 -> detect key 0 from PICC level via secure channel D40\n"
|
||||||
"hf mfdes detect --dict mfdes_default_keys -> detect key 0 from PICC level with help of the standard dictionary\n"
|
"hf mfdes detect --dict mfdes_default_keys -> detect key 0 from PICC level with help of the standard dictionary\n"
|
||||||
"hf mfdes detect --aid 123456 -n 2 --save -> detect key 2 from app 123456 and if succeed - save params to defaults (`default` command)");
|
"hf mfdes detect --aid 123456 -n 2 --save -> detect key 2 from app 123456 and if succeed - save params to defaults (`default` command)\n"
|
||||||
|
"hf mfdes detect --appisoid df01 --save -> detect key 0 and save to defaults with card in the LRP mode");
|
||||||
|
|
||||||
void *argtable[] = {
|
void *argtable[] = {
|
||||||
arg_param_begin,
|
arg_param_begin,
|
||||||
|
@ -1377,6 +1378,7 @@ static int CmdHF14aDesDetect(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool keytypes[4] = {0};
|
bool keytypes[4] = {0};
|
||||||
|
bool uselrp = false;
|
||||||
|
|
||||||
uint8_t data[250] = {0};
|
uint8_t data[250] = {0};
|
||||||
size_t datalen = 0;
|
size_t datalen = 0;
|
||||||
|
@ -1413,6 +1415,11 @@ static int CmdHF14aDesDetect(const char *Cmd) {
|
||||||
if (authCmdCheck.authAES || authCmdCheck.authEV2) {
|
if (authCmdCheck.authAES || authCmdCheck.authEV2) {
|
||||||
keytypes[T_AES] = true;
|
keytypes[T_AES] = true;
|
||||||
}
|
}
|
||||||
|
if (authCmdCheck.authLRP) {
|
||||||
|
keytypes[T_AES] = true;
|
||||||
|
uselrp = true;
|
||||||
|
securechann = DACLRP;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// if nothing helps - we check DES only
|
// if nothing helps - we check DES only
|
||||||
keytypes[T_DES] = true;
|
keytypes[T_DES] = true;
|
||||||
|
@ -1431,11 +1438,12 @@ static int CmdHF14aDesDetect(const char *Cmd) {
|
||||||
PrintAndLogEx(INFO, "Check PICC key num: %d (0x%02x)", dctx.keyNum, dctx.keyNum);
|
PrintAndLogEx(INFO, "Check PICC key num: %d (0x%02x)", dctx.keyNum, dctx.keyNum);
|
||||||
else
|
else
|
||||||
PrintAndLogEx(INFO, "Check: %s key num: %d (0x%02x)", DesfireWayIDStr(selectway, id), dctx.keyNum, dctx.keyNum);
|
PrintAndLogEx(INFO, "Check: %s key num: %d (0x%02x)", DesfireWayIDStr(selectway, id), dctx.keyNum, dctx.keyNum);
|
||||||
PrintAndLogEx(INFO, "keys: DES: %s 2TDEA: %s 3TDEA: %s AES: %s",
|
PrintAndLogEx(INFO, "keys: DES: %s 2TDEA: %s 3TDEA: %s AES: %s LRP: %s",
|
||||||
keytypes[T_DES] ? _GREEN_("YES") : _RED_("NO"),
|
keytypes[T_DES] ? _GREEN_("YES") : _RED_("NO"),
|
||||||
keytypes[T_3DES] ? _GREEN_("YES") : _RED_("NO"),
|
keytypes[T_3DES] ? _GREEN_("YES") : _RED_("NO"),
|
||||||
keytypes[T_3K3DES] ? _GREEN_("YES") : _RED_("NO"),
|
keytypes[T_3K3DES] ? _GREEN_("YES") : _RED_("NO"),
|
||||||
keytypes[T_AES] ? _GREEN_("YES") : _RED_("NO")
|
keytypes[T_AES] ? _GREEN_("YES") : _RED_("NO"),
|
||||||
|
uselrp ? _GREEN_("YES") : _RED_("NO")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1531,7 +1539,8 @@ static int CmdHF14aDesDetect(const char *Cmd) {
|
||||||
else
|
else
|
||||||
PrintAndLogEx(INFO, "Found key for: %s key num: %d (0x%02x)", DesfireWayIDStr(selectway, id), dctx.keyNum, dctx.keyNum);
|
PrintAndLogEx(INFO, "Found key for: %s key num: %d (0x%02x)", DesfireWayIDStr(selectway, id), dctx.keyNum, dctx.keyNum);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "key " _GREEN_("%s") " [%d]: " _GREEN_("%s"),
|
PrintAndLogEx(INFO, "channel " _GREEN_("%s") " key " _GREEN_("%s") " [%d]: " _GREEN_("%s"),
|
||||||
|
CLIGetOptionListStr(DesfireSecureChannelOpts, securechann),
|
||||||
CLIGetOptionListStr(DesfireAlgoOpts, dctx.keyType),
|
CLIGetOptionListStr(DesfireAlgoOpts, dctx.keyType),
|
||||||
desfire_get_key_length(dctx.keyType),
|
desfire_get_key_length(dctx.keyType),
|
||||||
sprint_hex(dctx.key, desfire_get_key_length(dctx.keyType)));
|
sprint_hex(dctx.key, desfire_get_key_length(dctx.keyType)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue