Merge pull request #1585 from merlokk/cif_awrite

Cipurse awrite command
This commit is contained in:
Oleg Moiseenko 2022-02-04 15:45:14 +02:00 committed by GitHub
commit e5f81bc348
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 485 additions and 129 deletions

View file

@ -200,6 +200,10 @@ int CIPURSEReadFileAttributes(uint8_t *result, size_t max_result_len, size_t *re
return CIPURSEExchange((sAPDU_t) {0x80, 0xce, 0x00, 0x00, 0, NULL}, result, max_result_len, result_len, sw);
}
int CIPURSEUpdateFileAttributes(uint8_t *data, uint16_t datalen, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw) {
return CIPURSEExchange((sAPDU_t) {0x80, 0xde, 0x00, 0x00, datalen, data}, result, max_result_len, result_len, sw);
}
int CIPURSEReadBinary(uint16_t offset, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw) {
return CIPURSEExchange((sAPDU_t) {0x00, 0xb0, (offset >> 8) & 0x7f, offset & 0xff, 0, NULL}, result, max_result_len, result_len, sw);
}
@ -442,10 +446,14 @@ static void CIPURSEPrintKeyAttribDGI(uint8_t *attr) {
const char *CIPURSEGetSMR(uint8_t smr) {
switch (smr) {
case 0x00: return "plain";
case 0x01: return "mac";
case 0x02: return "enc";
default: return "unknown";
case 0x00:
return "plain";
case 0x01:
return "mac";
case 0x02:
return "enc";
default:
return "unknown";
}
return "unknown";
}
@ -477,35 +485,35 @@ void CIPURSEPrintART(uint8_t *artrec, size_t artlen) {
}
void CIPURSEPrintEFFileAttr(uint8_t *attr, size_t len) {
CIPURSEPrintFileDescriptor(attr[0]);
CIPURSEPrintFileDescriptor(attr[0]);
if (attr[1] == 0)
PrintAndLogEx(INFO, "SFI.... not assigned");
else
PrintAndLogEx(INFO, "SFI.... 0x%02x", attr[1]);
if (attr[1] == 0)
PrintAndLogEx(INFO, "SFI.... not assigned");
else
PrintAndLogEx(INFO, "SFI.... 0x%02x", attr[1]);
PrintAndLogEx(INFO, "File ID... 0x%02x%02x", attr[2], attr[3]);
PrintAndLogEx(INFO, "File ID... 0x%02x%02x", attr[2], attr[3]);
if (attr[0] == 0x01 || attr[0] == 0x11)
PrintAndLogEx(INFO, "File size... %d", (attr[4] << 8) + attr[5]);
else
PrintAndLogEx(INFO, "Record num " _YELLOW_("%d") " record size " _YELLOW_("%d"), attr[4], attr[5]);
if (attr[0] == 0x01 || attr[0] == 0x11)
PrintAndLogEx(INFO, "File size... %d", (attr[4] << 8) + attr[5]);
else
PrintAndLogEx(INFO, "Record num " _YELLOW_("%d") " record size " _YELLOW_("%d"), attr[4], attr[5]);
PrintAndLogEx(INFO, "Keys assigned... %d", attr[6]);
PrintAndLogEx(INFO, "Keys assigned... %d", attr[6]);
if (len >= 9) {
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[7], attr[8]);
CIPURSEPrintSMR(&attr[7]);
}
if (len >= 10) {
PrintAndLogEx(INFO, "ART... %s", sprint_hex(&attr[9], len - 9));
CIPURSEPrintART(&attr[9], len - 9);
if (attr[6] + 1 != len - 9) {
PrintAndLogEx(WARNING, "ART length is wrong");
}
if (len >= 9) {
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[7], attr[8]);
CIPURSEPrintSMR(&attr[7]);
}
if (len >= 10) {
PrintAndLogEx(INFO, "ART... %s", sprint_hex(&attr[9], len - 9));
CIPURSEPrintART(&attr[9], len - 9);
if (attr[6] + 1 != len - 9) {
PrintAndLogEx(WARNING, "ART length is wrong");
}
}
}
void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI) {
@ -555,7 +563,7 @@ void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI) {
PrintAndLogEx(INFO, "Keys assigned... %d", keynum);
int idx = 7;
if ( keynum > 0) {
if (keynum > 0) {
if (len >= idx + 2) {
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[idx], attr[idx + 1]);
CIPURSEPrintSMR(&attr[idx]);
@ -610,3 +618,34 @@ void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI) {
void CIPURSEPrintFileAttr(uint8_t *attr, size_t len) {
return CIPURSEPrintFileAttrEx(attr, len, false);
}
void CIPURSEPrintFileUpdateAttr(uint8_t *attr, size_t len) {
uint8_t keynum = attr[0];
PrintAndLogEx(INFO, "Keys assigned... %d", keynum);
size_t idx = 1;
if (keynum > 0) {
if (len >= idx + 2) {
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[idx], attr[idx + 1]);
CIPURSEPrintSMR(&attr[idx]);
}
idx += 2;
if (len >= idx + keynum + 1) {
PrintAndLogEx(INFO, "ART... %s", sprint_hex(&attr[idx], keynum + 1));
CIPURSEPrintART(&attr[idx], keynum + 1);
PrintAndLogEx(NORMAL, "");
}
idx += keynum + 1;
}
// FCI
if (len >= idx + 1) {
int xlen = len - idx;
if (xlen > 0 && xlen < 200) {
PrintAndLogEx(INFO, "TLV file control parameters... [%d] %s", xlen, sprint_hex(&attr[idx], xlen));
TLVPrintFromBuffer(&attr[idx], xlen);
PrintAndLogEx(NORMAL, "");
}
}
}

View file

@ -51,6 +51,7 @@ int CIPURSESelectMFEx(bool activate_field, bool leave_field_on, uint8_t *result,
int CIPURSESelectMF(uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
int CIPURSEReadFileAttributes(uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
int CIPURSEUpdateFileAttributes(uint8_t *data, uint16_t datalen, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
int CIPURSEReadBinary(uint16_t offset, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
int CIPURSEUpdateBinary(uint16_t offset, uint8_t *data, uint16_t datalen, uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw);
@ -66,6 +67,7 @@ void CIPURSEPrintART(uint8_t *artrec, size_t artlen);
void CIPURSEPrintEFFileAttr(uint8_t *attr, size_t len);
void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI);
void CIPURSEPrintFileAttr(uint8_t *attr, size_t len);
void CIPURSEPrintFileUpdateAttr(uint8_t *attr, size_t len);
void CIPURSEPrintFileDescriptor(uint8_t desc);
void CIPURSEPrintDGIArray(uint8_t *dgi, size_t dgilen);
void CIPURSEPrintDGI(uint8_t *dgi, size_t dgilen);

View file

@ -188,8 +188,8 @@ static int CmdHFCipurseInfo(const char *Cmd) {
}
static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size_t aidid, size_t fidid, size_t chfidid, size_t sreqid, size_t srespid,
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid, uint16_t *chfid, bool *usechfid,
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid, uint16_t *chfid, bool *usechfid,
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
uint8_t hdata[250] = {0};
int hdatalen = sizeof(hdata);
if (keyid) {
@ -313,15 +313,15 @@ static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size
}
static int CLIParseCommandParameters(CLIParserContext *ctx, size_t keyid, size_t aidid, size_t fidid, size_t sreqid, size_t srespid,
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid,
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid,
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
return CLIParseCommandParametersEx(ctx, keyid, aidid, fidid, 0, sreqid, srespid,
key, aid, aidlen, useaid, fid, usefid, NULL, NULL, sreq, sresp);
key, aid, aidlen, useaid, fid, usefid, NULL, NULL, sreq, sresp);
}
static int SelectCommandEx(bool selectDefaultFile, bool useAID, uint8_t *aid, size_t aidLen, bool useFID, uint16_t fileId,
bool selChildFile, uint16_t childFileId, bool verbose,
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
bool selChildFile, uint16_t childFileId, bool verbose,
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
int res = 0;
if (verbose && selChildFile)
PrintAndLogEx(INFO, "Select top level application/file");
@ -381,7 +381,7 @@ static int SelectCommandEx(bool selectDefaultFile, bool useAID, uint8_t *aid, si
}
static int SelectCommand(bool selectDefaultFile, bool useAID, uint8_t *aid, size_t aidLen, bool useFID, uint16_t fileId, bool verbose,
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
return SelectCommandEx(selectDefaultFile, useAID, aid, aidLen, useFID, fileId, false, 0, verbose, buf, bufSize, len, sw);
}
@ -834,7 +834,7 @@ static int CmdHFCipurseReadFileAttr(const char *Cmd) {
res = SelectCommandEx(selmfd, useAID, aid, aidLen, useFID, fileId, useChildFID, childFileId, verbose, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(WARNING, "useaid=%d res=%d sw=%x", useAID, res, sw);
PrintAndLogEx(ERR, "Select command ( " _RED_("error") " )");
DropField();
return PM3_ESOFT;
}
@ -852,9 +852,9 @@ static int CmdHFCipurseReadFileAttr(const char *Cmd) {
if (!noAuth)
PrintAndLogEx(INFO, "Key id " _YELLOW_("%d") " key " _YELLOW_("%s")
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
}
if (noAuth == false) {
@ -893,6 +893,144 @@ static int CmdHFCipurseReadFileAttr(const char *Cmd) {
return PM3_SUCCESS;
}
static int CmdHFCipurseWriteFileAttr(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf cipurse awrite",
"Write file attributes by file ID with key ID and key. If no key is supplied, default key of 737373...7373 will be used",
"hf cipurse awrite --fid 2ff7 -d 080000C1C1C1C1C1C1C1C1C1 -> write default file attributes with id 2ff7\n"
"hf cipurse awrite --mfd -d 080000FFFFFFFFFFFFFFFFFF86023232 --commit -> write file attributes for master file (MF)\n"
"hf cipurse awrite --chfid 0102 -d 020000ffffff -> write file 0102 attributes in the default application to full access\n"
"hf cipurse awrite --chfid 0102 -d 02000040ffff -> write file 0102 attributes in the default application to full access with keys 1 and 2\n");
void *argtable[] = {
arg_param_begin,
arg_lit0("a", "apdu", "show APDU requests and responses"),
arg_lit0("v", "verbose", "show technical data"),
arg_int0("n", NULL, "<dec>", "key ID"),
arg_str0("k", "key", "<hex>", "Auth key"),
arg_lit0(NULL, "mfd", "show info about master file"),
arg_str0(NULL, "aid", "<hex 1..16 bytes>", "select application ID (AID)"),
arg_str0(NULL, "fid", "<hex>", "file ID"),
arg_str0(NULL, "chfid", "<hex 2 bytes>", "child file ID (EF under application/master file)"),
arg_lit0(NULL, "noauth", "read file attributes without authentication"),
arg_str0(NULL, "sreq", "<plain|mac(default)|encode>", "communication reader-PICC security level"),
arg_str0(NULL, "sresp", "<plain|mac(default)|encode>", "communication PICC-reader security level"),
arg_str0("d", "data", "<hex>", "file attributes"),
arg_lit0(NULL, "commit", "need commit after write"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, false);
bool APDULogging = arg_get_lit(ctx, 1);
bool verbose = arg_get_lit(ctx, 2);
uint8_t keyId = arg_get_int_def(ctx, 3, defaultKeyId);
bool selmfd = arg_get_lit(ctx, 5);
CipurseChannelSecurityLevel sreq = CPSMACed;
CipurseChannelSecurityLevel sresp = CPSMACed;
uint8_t key[CIPURSE_AES_KEY_LENGTH] = {0};
uint8_t aid[16] = {0};
size_t aidLen = 0;
bool useAID = false;
uint16_t fileId = defaultFileId;
bool useFID = false;
uint16_t childFileId = defaultFileId;
bool useChildFID = false;
int res = CLIParseCommandParametersEx(ctx, 4, 6, 7, 8, 10, 11, key, aid, &aidLen, &useAID, &fileId, &useFID, &childFileId, &useChildFID, &sreq, &sresp);
if (res) {
CLIParserFree(ctx);
return PM3_EINVARG;
}
bool noAuth = arg_get_lit(ctx, 9);
uint8_t hdata[250] = {0};
int hdatalen = sizeof(hdata);
CLIGetHexWithReturn(ctx, 12, hdata, &hdatalen);
if (hdatalen == 0) {
PrintAndLogEx(ERR, _RED_("ERROR:") " file attributes length must be more 0");
CLIParserFree(ctx);
return PM3_EINVARG;
}
bool needCommit = arg_get_lit(ctx, 13);
CLIParserFree(ctx);
SetAPDULogging(APDULogging);
if (verbose) {
PrintAndLogEx(INFO, "attribtes data[%zu]: %s", hdatalen, sprint_hex(hdata, hdatalen));
CIPURSEPrintFileUpdateAttr(hdata, hdatalen);
}
uint8_t buf[APDU_RES_LEN] = {0};
size_t len = 0;
uint16_t sw = 0;
res = SelectCommandEx(selmfd, useAID, aid, aidLen, useFID, fileId, useChildFID, childFileId, verbose, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Select command ( " _RED_("error") " )");
DropField();
return PM3_ESOFT;
}
if (verbose) {
if (selmfd)
PrintAndLogEx(INFO, "File " _CYAN_("Master File"));
else if (useFID)
PrintAndLogEx(INFO, "File id " _CYAN_("%04x"), fileId);
else
PrintAndLogEx(INFO, "Application ID " _CYAN_("%s"), sprint_hex_inrow(aid, aidLen));
if (useChildFID)
PrintAndLogEx(INFO, "Child file id " _CYAN_("%04x"), childFileId);
if (!noAuth)
PrintAndLogEx(INFO, "Key id " _YELLOW_("%d") " key " _YELLOW_("%s")
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
}
if (noAuth == false) {
bool bres = CIPURSEChannelAuthenticate(keyId, key, verbose);
if (bres == false) {
if (verbose == false)
PrintAndLogEx(ERR, "Authentication ( " _RED_("fail") " )");
DropField();
return PM3_ESOFT;
}
// set channel security levels
CIPURSECSetActChannelSecurityLevels(sreq, sresp);
}
res = CIPURSEUpdateFileAttributes(hdata, hdatalen, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
if (verbose == false)
PrintAndLogEx(ERR, "File attributes update " _RED_("ERROR") ". Card returns 0x%04x", sw);
DropField();
return PM3_ESOFT;
}
PrintAndLogEx(INFO, "File attributes updated ( " _GREEN_("ok") " )");
if (needCommit) {
sw = 0;
res = CIPURSECommitTransaction(&sw);
if (res != 0 || sw != 0x9000)
PrintAndLogEx(WARNING, "Commit " _YELLOW_("ERROR") ". Card returns 0x%04x", sw);
if (verbose)
PrintAndLogEx(INFO, "Commit ( " _GREEN_("ok") " )");
}
DropField();
return PM3_SUCCESS;
}
static int CmdHFCipurseFormatAll(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf cipurse formatall",
@ -947,9 +1085,9 @@ static int CmdHFCipurseFormatAll(const char *Cmd) {
PrintAndLogEx(WARNING, _YELLOW_("FORMAT erases all the data at this card!!!"));
if (!noauth)
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
}
if (!noauth) {
@ -983,7 +1121,7 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
"Create application/file/key by provide appropriate DGI. If no key is supplied, default key of 737373...7373 will be used",
"hf cipurse create -d 9200123F00200008000062098407A0000005070100 -> create PTSE file with FID 0x2000 and space for 8 AIDs\n"
"hf cipurse create -d 92002438613F010A050200004040FF021009021009621084054144204631D407A0000005070100A00F28"
"73737373737373737373737373737373015FD67B000102030405060708090A0B0C0D0E0F01C6A13B -> create default file with FID 3F01 and 2 keys\n"
"73737373737373737373737373737373015FD67B000102030405060708090A0B0C0D0E0F01C6A13B -> create default file with FID 3F01 and 2 keys\n"
"hf cipurse create --aid 4144204631 -d 92010C010001020030020000FFFFFF -> create 0x0102 binary data EF under application 4144204631\n");
void *argtable[] = {
@ -1052,6 +1190,7 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
if (useAID || useFID || selmfd) {
res = SelectCommand(selmfd, useAID, aid, aidLen, useFID, fileId, verbose, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Select command ( " _RED_("error") " )");
DropField();
return PM3_ESOFT;
}
@ -1069,9 +1208,9 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
if (verbose) {
if (!noauth)
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
}
if (!noauth) {
@ -1090,7 +1229,7 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
res = CIPURSECreateFile(hdata, hdatalen, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Create file command " _RED_("ERROR") ". Card returns:\n 0x%04x - %s", sw,
GetSpecificAPDUCodeDesc(SelectAPDUCodeDescriptions, ARRAYLEN(SelectAPDUCodeDescriptions), sw));
GetSpecificAPDUCodeDesc(SelectAPDUCodeDescriptions, ARRAYLEN(SelectAPDUCodeDescriptions), sw));
DropField();
return PM3_ESOFT;
}
@ -1175,9 +1314,9 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
if (!noauth)
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
, keyId
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
);
}
uint8_t buf[APDU_RES_LEN] = {0};
@ -1192,7 +1331,7 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
return PM3_ESOFT;
}
} else {
res = CIPURSESelectMFEx(true, true, buf, sizeof(buf), &len, &sw);
res = CIPURSESelectMFEx(true, true, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Cipurse masterfile select " _RED_("error") ". Card returns 0x%04x", sw);
DropField();
@ -1217,7 +1356,7 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
res = CIPURSEDeleteFile(childFileId, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Delete child file " _CYAN_("%04x ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s", childFileId, sw,
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
DropField();
return PM3_ESOFT;
}
@ -1226,7 +1365,7 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
res = CIPURSEDeleteFile(fileId, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Delete file " _CYAN_("%04x ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s", fileId, sw,
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
DropField();
return PM3_ESOFT;
}
@ -1235,9 +1374,9 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
res = CIPURSEDeleteFileAID(aid, aidLen, buf, sizeof(buf), &len, &sw);
if (res != 0 || sw != 0x9000) {
PrintAndLogEx(ERR, "Delete application " _CYAN_("%s ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s",
sprint_hex_inrow(aid, aidLen),
sw,
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
sprint_hex_inrow(aid, aidLen),
sw,
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
DropField();
return PM3_ESOFT;
}
@ -1325,7 +1464,6 @@ static int CmdHFCipurseDefault(const char *Cmd) {
CLIParserFree(ctx);
PrintAndLogEx(INFO, "------------------- " _CYAN_("Default parameters") " -------------------");
PrintAndLogEx(INFO, "Key ID : %d", defaultKeyId);
@ -1344,6 +1482,7 @@ static command_t CommandTable[] = {
{"read", CmdHFCipurseReadFile, IfPm3Iso14443a, "Read binary file"},
{"write", CmdHFCipurseWriteFile, IfPm3Iso14443a, "Write binary file"},
{"aread", CmdHFCipurseReadFileAttr, IfPm3Iso14443a, "Read file attributes"},
{"awrite", CmdHFCipurseWriteFileAttr, IfPm3Iso14443a, "Write file attributes"},
{"formatall", CmdHFCipurseFormatAll, IfPm3Iso14443a, "Erase all the data from chip"},
{"create", CmdHFCipurseCreateDGI, IfPm3Iso14443a, "Create file, application, key via DGI record"},
{"delete", CmdHFCipurseDeleteFile, IfPm3Iso14443a, "Delete file"},

View file

@ -491,7 +491,7 @@ static void emv_tag_dump_dol(const struct tlv *tlv, const struct emv_tag *tag, i
const struct emv_tag *doltag;
if (!tlv_parse_tl(&buf, &left, &doltlv)) {
PrintAndLogEx(INFO, "%*sInvalid Tag-Len" , (level * 4), " ");
PrintAndLogEx(INFO, "%*sInvalid Tag-Len", (level * 4), " ");
continue;
}
@ -557,7 +557,7 @@ static uint32_t emv_get_binary(const unsigned char *S) {
// https://github.com/binaryfoo/emv-bertlv/blob/master/src/main/resources/fields/visa-cvr.txt
static void emv_tag_dump_cvr(const struct tlv *tlv, const struct emv_tag *tag, int level) {
if (tlv == NULL || tlv->len < 1) {
PrintAndLogEx(INFO, "%*s INVALID length!" , (level * 4), " ");
PrintAndLogEx(INFO, "%*s INVALID length!", (level * 4), " ");
return;
}

View file

@ -173,6 +173,24 @@ or with default application
```hf cipurse aread --aid 4144204632 --chfid 0102```
### How set file attributes
^[Top](#top)
set elementary file attributes (EF)
full access wo keys
```hf cipurse awrite --chfid 0102 -d 020000ffffff```
read access wo keys and full with all 2 keys
```hf cipurse awrite --chfid 0102 -d 02000040ffff```
set EF.ID_INFO file attributes
```hf cipurse awrite --fid 2ff7 -d 080000C1C1C1C1C1C1C1C1C1``` (as default)
set master file (MF) file attributes
```hf cipurse awrite --mfd -d 080000FFFFFFFFFFFFFFFFFF86023232 --commit``` (full access with/wo keys and tag 86 is set by `22`)
### How to personalize card
^[Top](#top)
@ -240,3 +258,19 @@ or if file with transaction mechanism
```hf cipurse read --fid 0102```
**8. Set the keys and needed key attributes**
TBW
**8. Set the file attributes**
Set file attributes for:
1. All the elementary files (EF)
2. Info files (EF.ID_INFO)
3. Application(s)
4. PxSE application
5. Master file itself (MF)
*(in this specific order!!!)*

View file

@ -1693,7 +1693,10 @@
"command": "hf cipurse aread",
"description": "read file attributes by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse aread --fid 2ff7 -> authenticate with keyid 1, read file attributes with id 2ff7",
"hf cipurse aread --fid 2ff7 -> select mf, authenticate with keyid 1, read file attributes with id 2ff7",
"hf cipurse aread --mfd -> read file attributes for master file (mf)",
"hf cipurse aread --chfid 0102 -> read file 0102 attributes in the default application",
"hf cipurse aread --aid 4144204632 --chfid 0102 -> read file 0102 attributes in the 4144204632 application",
"hf cipurse aread -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2, read file attributes"
],
"offline": false,
@ -1703,14 +1706,15 @@
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--mfd show info about master file",
"--aid <hex 1..16 bytes> select application id (aid)",
"--fid <hex> file id",
"--chfid <hex 2 bytes> child file id (ef under application/master file)",
"--noauth read file attributes without authentication",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
"--sel-adf show info about adf itself",
"--sel-mf show info about master file"
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
],
"usage": "hf cipurse aread [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--sel-adf] [--sel-mf]"
"usage": "hf cipurse aread [-hav] [-n <dec>] [-k <hex>] [--mfd] [--aid <hex 1..16 bytes>] [--fid <hex>] [--chfid <hex 2 bytes>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
},
"hf cipurse auth": {
"command": "hf cipurse auth",
@ -1724,33 +1728,22 @@
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"--aid <hex 1..16 bytes> application id (aid)",
"--fid <hex 2 bytes> top file/application id (fid)",
"--mfd select masterfile by empty id",
"-n <dec> key id",
"-k, --key <hex> auth key"
],
"usage": "hf cipurse auth [-hav] [-n <dec>] [-k <hex>]"
"usage": "hf cipurse auth [-hav] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>] [--mfd] [-n <dec>] [-k <hex>]"
},
"hf cipurse default": {
"command": "hf cipurse default",
"description": "set default parameters for access to cipurse card",
"hf cipurse awrite": {
"command": "hf cipurse awrite",
"description": "write file attributes by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse default -n 1 -k 65656565656565656565656565656565 --fid 2ff7 -> set key, key id and file id"
],
"offline": false,
"options": [
"-h, --help this help",
"--clear resets to defaults",
"-n <dec> key id",
"-k, --key <hex> authentication key",
"--fid <hex> file id"
],
"usage": "hf cipurse default [-h] [--clear] [-n <dec>] [-k <hex>] [--fid <hex>]"
},
"hf cipurse delete": {
"command": "hf cipurse delete",
"description": "read file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse delete --fid 2ff7 -> authenticate with keyid 1, delete file with id 2ff7",
"hf cipurse delete -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and delete file"
"hf cipurse awrite --fid 2ff7 -d 080000c1c1c1c1c1c1c1c1c1 -> write default file attributes with id 2ff7",
"hf cipurse awrite --mfd -d 080000ffffffffffffffffff86023232 --commit -> write file attributes for master file (mf)",
"hf cipurse awrite --chfid 0102 -d 020000ffffff -> write file 0102 attributes in the default application to full access",
"hf cipurse awrite --chfid 0102 -d 02000040ffff -> write file 0102 attributes in the default application to full access with keys 1 and 2"
],
"offline": false,
"options": [
@ -1759,11 +1752,109 @@
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--mfd show info about master file",
"--aid <hex 1..16 bytes> select application id (aid)",
"--fid <hex> file id",
"--chfid <hex 2 bytes> child file id (ef under application/master file)",
"--noauth read file attributes without authentication",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
"-d, --data <hex> file attributes",
"--commit need commit after write"
],
"usage": "hf cipurse delete [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
"usage": "hf cipurse awrite [-hav] [-n <dec>] [-k <hex>] [--mfd] [--aid <hex 1..16 bytes>] [--fid <hex>] [--chfid <hex 2 bytes>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [-d <hex>] [--commit]"
},
"hf cipurse create": {
"command": "hf cipurse create",
"description": "create application/file/key by provide appropriate dgi. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse create -d 9200123f00200008000062098407a0000005070100 -> create ptse file with fid 0x2000 and space for 8 aids",
"hf cipurse create -d 92002438613f010a050200004040ff021009021009621084054144204631d407a0000005070100a00f2873737373737373737373737373737373015fd67b000102030405060708090a0b0c0d0e0f01c6a13b -> create default file with fid 3f01 and 2 keys",
"hf cipurse create --aid 4144204631 -d 92010c010001020030020000ffffff -> create 0x0102 binary data ef under application 4144204631"
],
"offline": false,
"options": [
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--aid <hex 1..16 bytes> application id (aid)",
"--fid <hex 2 bytes> file id (fid)",
"--mfd select masterfile by empty id",
"-d, --data <hex> data with dgi for create",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
"--no-auth execute without authentication",
"--commit need commit after create"
],
"usage": "hf cipurse create [-hav] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>] [--mfd] [-d <hex>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--no-auth] [--commit]"
},
"hf cipurse default": {
"command": "hf cipurse default",
"description": "set default parameters for access to cipurse card",
"notes": [
"hf cipurse default --reset -> reset parameters to default",
"hf cipurse default -n 1 -k 65656565656565656565656565656565 --fid 2ff7 -> set key, key id and file id",
"hf cipurse default --aid 4144204632 -> set default application id"
],
"offline": false,
"options": [
"-h, --help this help",
"--clear resets to defaults",
"-n <dec> key id",
"-k, --key <hex> authentication key",
"--aid <hex 1..16 bytes> application id (aid)",
"--fid <hex 2 bytes> file id"
],
"usage": "hf cipurse default [-h] [--clear] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>]"
},
"hf cipurse delete": {
"command": "hf cipurse delete",
"description": "delete file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse delete --fid 2ff7 -> authenticate with keyid 1, delete file with id 2ff7 at top level",
"hf cipurse delete -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and delete file",
"hf cipurse delete --aid a0000005070100 --no-auth -> delete ptse file with aid a0000005070100 without authentication",
"hf cipurse delete --aid 4144204631 --chfid 0102 -> delete ef with fid 0x0102 under default application"
],
"offline": false,
"options": [
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--fid <hex> file/application id under mf for delete",
"--aid <hex 1..16 bytes> application id (aid) for delete",
"--chfid <hex 2 bytes> child file id (ef under application/master file)",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
"--no-auth execute without authentication",
"--commit commit"
],
"usage": "hf cipurse delete [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [--aid <hex 1..16 bytes>] [--chfid <hex 2 bytes>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--no-auth] [--commit]"
},
"hf cipurse formatall": {
"command": "hf cipurse formatall",
"description": "format card. erases all the data at the card level!",
"notes": [
"hf cipurse formatall -> format card with default key",
"hf cipurse formatall -n 2 -k 65656565656565656565656565656565 -> format card with keyid 2",
"hf cipurse formatall --no-auth -> format card without authentication. works for card in perso state"
],
"offline": false,
"options": [
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
"--no-auth execute without authentication"
],
"usage": "hf cipurse formatall [-hav] [-n <dec>] [-k <hex>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--no-auth]"
},
"hf cipurse help": {
"command": "hf cipurse help",
@ -1779,10 +1870,11 @@
},
"hf cipurse read": {
"command": "hf cipurse read",
"description": "read file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"description": "read file in the application by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse read --fid 2ff7 -> authenticate with keyid 1, read file with id 2ff7",
"hf cipurse read -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and read file"
"hf cipurse read -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and read file",
"hf cipurse read --aid 4144204631 --fid 0102 -> read file with id 0102 from application 4144204631"
],
"offline": false,
"options": [
@ -1791,13 +1883,36 @@
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--aid <hex 1..16 bytes> application id (aid)",
"--fid <hex> file id",
"-o, --offset <dec> offset for reading data from file",
"--noauth read file without authentication",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
],
"usage": "hf cipurse read [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
"usage": "hf cipurse read [-hav] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
},
"hf cipurse select": {
"command": "hf cipurse select",
"description": "select application or file",
"notes": [
"hf cipurse select --aid a0000005070100 -> select ptse application by aid",
"hf cipurse select --fid 3f00 -> select master file by fid 3f00",
"hf cipurse select --fid 2ff7 -> select attribute file by fid 2ff7",
"hf cipurse select --mfd -vt -> select default file by empty fid and show response data in plain and tlv decoded format"
],
"offline": false,
"options": [
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-t, --tlv tlv decode returned data",
"--aid <hex 1..16 bytes> application id (aid)",
"--fid <hex 2 bytes> top level file (or application) id (fid)",
"--mfd select masterfile by empty id",
"--chfid <hex 2 bytes> child file id (ef under application/master file)"
],
"usage": "hf cipurse select [-havt] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>] [--mfd] [--chfid <hex 2 bytes>]"
},
"hf cipurse test": {
"command": "hf cipurse test",
@ -1816,10 +1931,12 @@
},
"hf cipurse write": {
"command": "hf cipurse write",
"description": "write file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"description": "write file in the application by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
"notes": [
"hf cipurse write --fid 2ff7 -> authenticate with keyid 1, write file with id 2ff7",
"hf cipurse write -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and write file"
"hf cipurse write --fid 2ff7 -d aabb -> authenticate with keyid 1, write file with id 2ff7",
"hf cipurse write -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -d aabb -> authenticate keyid 2 and write file",
"hf cipurse write --aid 4144204631 --fid 0102 -d aabb -> write file with id 0102 in the 4144204631 application",
"hf cipurse write --fid 0102 -d aabb --commit -> write file with id 0102 and perform commit after write"
],
"offline": false,
"options": [
@ -1828,14 +1945,16 @@
"-v, --verbose show technical data",
"-n <dec> key id",
"-k, --key <hex> auth key",
"--aid <hex 1..16 bytes> application id (aid)",
"--fid <hex> file id",
"-o, --offset <dec> offset for reading data from file",
"--noauth read file without authentication",
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
"-d, --data <hex> hex data to write to new file"
"-d, --data <hex> hex data to write to new file",
"--commit need commit after write"
],
"usage": "hf cipurse write [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [-d <hex>]"
"usage": "hf cipurse write [-hav] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [-d <hex>] [--commit]"
},
"hf emrtd help": {
"command": "hf emrtd help",
@ -4130,19 +4249,19 @@
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-n, --keyno <keyno> key number",
"-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2/lrp> secure channel: d40/ev1/ev2/lrp",
"--aid <app id hex> application id of application for some parameters (3 hex bytes, big endian)",
"--appisoid <isoid hex> application iso id (iso df id) (2 hex bytes, big endian).",
"-n, --keyno <dec> key number",
"-t, --algo <des|2tdea|3tdea|aes> crypt algo: des, 2tdea, 3tdea, aes",
"-k, --key <hex> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none|an10922|gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <hex> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain|mac|encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native|niso|iso> communicaton command set: native/niso/iso",
"-s, --schann <d40|ev1|ev2|lrp> secure channel: d40/ev1/ev2/lrp",
"--aid <hex> application id of application for some parameters (3 hex bytes, big endian)",
"--appisoid <hex> application iso id (iso df id) (2 hex bytes, big endian).",
"--save saves channels parameters to defaults if authentication succeeds"
],
"usage": "hf mfdes auth [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2/lrp>] [--aid <app id hex>] [--appisoid <isoid hex>] [--save]"
"usage": "hf mfdes auth [-hav] [-n <dec>] [-t <des|2tdea|3tdea|aes>] [-k <hex>] [-f <none|an10922|gallagher>] [-i <hex>] [-m <plain|mac|encrypt>] [-c <native|niso|iso>] [-s <d40|ev1|ev2|lrp>] [--aid <hex>] [--appisoid <hex>] [--save]"
},
"hf mfdes bruteaid": {
"command": "hf mfdes bruteaid",
@ -8328,6 +8447,7 @@
"description": "clone a farpointe/pyramid tag to a t55x7, q5/t5555 or em4305/4469 tag. the facility-code is 8-bit and the card number is 16-bit. larger values are truncated. currently only works on 26bit",
"notes": [
"lf pyramid clone --fc 123 --cn 11223",
"lf pyramid clone --raw 0001010101010101010440013223921c",
"lf pyramid clone --fc 123 --cn 11223 --q5 -> encode for q5/t5555 tag",
"lf pyramid clone --fc 123 --cn 11223 --em -> encode for em4305/4469"
],
@ -8337,9 +8457,10 @@
"--fc <dec> 8-bit value facility code",
"--cn <dec> 16-bit value card number",
"--q5 optional - specify writing to q5/t5555 tag",
"--em optional - specify writing to em4305/4469 tag"
"--em optional - specify writing to em4305/4469 tag",
"-r, --raw <hex> raw hex data. 16 bytes"
],
"usage": "lf pyramid clone [-h] --fc <dec> --cn <dec> [--q5] [--em]"
"usage": "lf pyramid clone [-h] [--fc <dec>] [--cn <dec>] [--q5] [--em] [-r <hex>]"
},
"lf pyramid help": {
"command": "lf pyramid help",
@ -8370,15 +8491,17 @@
"command": "lf pyramid sim",
"description": "enables simulation of farpointe/pyramid card with specified card number. simulation runs until the button is pressed or another usb command is issued. the facility-code is 8-bit and the card number is 16-bit. larger values are truncated. currently work only on 26bit",
"notes": [
"lf pyramid sim --fc 123 --cn 1337"
"lf pyramid sim --fc 123 --cn 1337",
"lf pyramid clone --raw 0001010101010101010440013223921c"
],
"offline": false,
"options": [
"-h, --help this help",
"--fc <dec> 8-bit value facility code",
"--cn <dec> 16-bit value card number"
"--cn <dec> 16-bit value card number",
"-r, --raw <hex> raw hex data. 16 bytes"
],
"usage": "lf pyramid sim [-h] --fc <dec> --cn <dec>"
"usage": "lf pyramid sim [-h] [--fc <dec>] [--cn <dec>] [-r <hex>]"
},
"lf read": {
"command": "lf read",
@ -9980,7 +10103,21 @@
},
"trace help": {
"command": "trace help",
"description": "help this help list list protocol data in trace buffer load load trace from file save save trace buffer to file --------------------------------------------------------------------------------------- trace list available offline: yes annotate trace buffer with selected protocol data you can load a trace from file (see `trace load -h`) or it be downloaded from device by default",
"description": "help this help extract extract authentication challenges found in trace list list protocol data in trace buffer load load trace from file save save trace buffer to file --------------------------------------------------------------------------------------- trace extract available offline: yes extracts protocol authentication challenges from trace buffer",
"notes": [
"trace extract",
"trace extract -1"
],
"offline": true,
"options": [
"-h, --help this help",
"-1, --buffer use data from trace buffer"
],
"usage": "trace extract [-h1]"
},
"trace list": {
"command": "trace list",
"description": "annotate trace buffer with selected protocol data you can load a trace from file (see `trace load -h`) or it be downloaded from device by default",
"notes": [
"trace list -t raw -> just show raw data without annotations",
"",
@ -10206,8 +10343,8 @@
}
},
"metadata": {
"commands_extracted": 598,
"commands_extracted": 603,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2022-01-23T19:02:27"
"extracted_on": "2022-02-04T13:37:03"
}
}

View file

@ -243,10 +243,14 @@ Check column "offline" for their availability.
|------- |------- |-----------
|`hf cipurse help `|Y |`This help.`
|`hf cipurse info `|N |`Get info about CIPURSE tag`
|`hf cipurse select `|N |`Select CIPURSE application or file`
|`hf cipurse auth `|N |`Authenticate CIPURSE tag`
|`hf cipurse read `|N |`Read binary file`
|`hf cipurse write `|N |`Write binary file`
|`hf cipurse aread `|N |`Read file attributes`
|`hf cipurse awrite `|N |`Write file attributes`
|`hf cipurse formatall `|N |`Erase all the data from chip`
|`hf cipurse create `|N |`Create file, application, key via DGI record`
|`hf cipurse delete `|N |`Delete file`
|`hf cipurse default `|N |`Set default key and file id for all the other commands`
|`hf cipurse test `|Y |`Tests`
@ -1287,6 +1291,7 @@ Check column "offline" for their availability.
|command |offline |description
|------- |------- |-----------
|`trace help `|Y |`This help`
|`trace extract `|Y |`Extract authentication challenges found in trace`
|`trace list `|Y |`List protocol data in trace buffer`
|`trace load `|Y |`Load trace from file`
|`trace save `|Y |`Save trace buffer to file`