mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
added no-auth
This commit is contained in:
parent
660647ab5a
commit
07d753dfea
1 changed files with 25 additions and 4 deletions
|
@ -6225,12 +6225,14 @@ static int CmdHF14ADesChFileSettings(const char *Cmd) {
|
||||||
arg_str0(NULL, "wrights", "<key0/../key13/free/deny>", "Write file access mode: the specified key, free, deny"),
|
arg_str0(NULL, "wrights", "<key0/../key13/free/deny>", "Write file access mode: the specified key, free, deny"),
|
||||||
arg_str0(NULL, "rwrights","<key0/../key13/free/deny>", "Read/Write file access mode: the specified key, free, deny"),
|
arg_str0(NULL, "rwrights","<key0/../key13/free/deny>", "Read/Write file access mode: the specified key, free, deny"),
|
||||||
arg_str0(NULL, "chrights","<key0/../key13/free/deny>", "Change file settings access mode: the specified key, free, deny"),
|
arg_str0(NULL, "chrights","<key0/../key13/free/deny>", "Change file settings access mode: the specified key, free, deny"),
|
||||||
|
arg_lit0(NULL, "no-auth", "execute without authentication"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
bool APDULogging = arg_get_lit(ctx, 1);
|
bool APDULogging = arg_get_lit(ctx, 1);
|
||||||
bool verbose = arg_get_lit(ctx, 2);
|
bool verbose = arg_get_lit(ctx, 2);
|
||||||
|
bool noauth = arg_get_lit(ctx, 19);
|
||||||
|
|
||||||
DesfireContext dctx;
|
DesfireContext dctx;
|
||||||
int securechann = defaultSecureChannel;
|
int securechann = defaultSecureChannel;
|
||||||
|
@ -6296,17 +6298,36 @@ static int CmdHF14ADesChFileSettings(const char *Cmd) {
|
||||||
SetAPDULogging(APDULogging);
|
SetAPDULogging(APDULogging);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
|
if (noauth) {
|
||||||
|
res = DesfireSelectAIDHex(&dctx, appid, false, 0);
|
||||||
|
if (res != PM3_SUCCESS) {
|
||||||
|
PrintAndLogEx(ERR, "Desfire select " _RED_("error") ".");
|
||||||
|
DropField();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
res = DesfireSelectAndAuthenticate(&dctx, securechann, appid, verbose);
|
res = DesfireSelectAndAuthenticate(&dctx, securechann, appid, verbose);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
DropField();
|
DropField();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
PrintAndLogEx(INFO, "app %06x file %02x settings[%d]: %s", appid, fileid, settingslen, sprint_hex(settings, settingslen));
|
PrintAndLogEx(INFO, "app %06x file %02x settings[%d]: %s", appid, fileid, settingslen, sprint_hex(settings, settingslen));
|
||||||
|
|
||||||
DesfirePrintSetFileSettings(settings, settingslen);
|
DesfirePrintSetFileSettings(settings, settingslen);
|
||||||
|
|
||||||
|
/* uint8_t buf[APDU_RES_LEN] = {0};
|
||||||
|
size_t buflen = 0;
|
||||||
|
|
||||||
|
res = DesfireGetFileSettings(&dctx, fileid, buf, &buflen);
|
||||||
|
if (res == PM3_SUCCESS && buflen > 5) {
|
||||||
|
uint8_t chright = buf[2] & 0x0f;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data[0] = fileid;
|
data[0] = fileid;
|
||||||
res = DesfireChangeFileSettings(&dctx, data, settingslen + 1);
|
res = DesfireChangeFileSettings(&dctx, data, settingslen + 1);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue