mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-12 04:35:28 -07:00
style
This commit is contained in:
parent
489ae506ab
commit
f5e976afa6
@ -285,12 +285,12 @@ static int ExecuteMode(int mode, int slot) {
|
||||
case LF_RWSB_MODE_WRITE:
|
||||
Dbprintf("[!!] >> Write mode started <<");
|
||||
copy_em410x_to_t55xx(LF_RWSB_T55XX_TYPE
|
||||
, LF_CLOCK
|
||||
, (uint32_t)(em4100rswb_low[slot] >> 32)
|
||||
, (uint32_t)(em4100rswb_low[slot] & 0xffffffff)
|
||||
, false
|
||||
, true
|
||||
);
|
||||
, LF_CLOCK
|
||||
, (uint32_t)(em4100rswb_low[slot] >> 32)
|
||||
, (uint32_t)(em4100rswb_low[slot] & 0xffffffff)
|
||||
, false
|
||||
, true
|
||||
);
|
||||
return LF_RWSB_UNKNOWN_RESULT;
|
||||
case LF_RWSB_MODE_BRUTE:
|
||||
Dbprintf("[=] >> Bruteforce mode started <<");
|
||||
|
@ -167,12 +167,12 @@ static void Wipe(void) {
|
||||
LED_C_ON();
|
||||
LED_D_ON();
|
||||
copy_em410x_to_t55xx(LF_RWSB_T55XX_TYPE
|
||||
, LF_CLOCK
|
||||
, (uint32_t) 0
|
||||
, (uint32_t) 0
|
||||
, false
|
||||
, false
|
||||
);
|
||||
, LF_CLOCK
|
||||
, (uint32_t) 0
|
||||
, (uint32_t) 0
|
||||
, false
|
||||
, false
|
||||
);
|
||||
SpinDelay(60);
|
||||
LEDsoff();
|
||||
LED_D_ON();
|
||||
@ -290,12 +290,12 @@ static void Write(void) {
|
||||
LED_A_ON();
|
||||
LED_B_ON();
|
||||
copy_em410x_to_t55xx(LF_RWSB_T55XX_TYPE
|
||||
, LF_CLOCK
|
||||
, (uint32_t)(low >> 32)
|
||||
, (uint32_t)(low & 0xffffffff)
|
||||
, false
|
||||
, false
|
||||
);
|
||||
, LF_CLOCK
|
||||
, (uint32_t)(low >> 32)
|
||||
, (uint32_t)(low & 0xffffffff)
|
||||
, false
|
||||
, false
|
||||
);
|
||||
SpinDelay(75);
|
||||
LEDsoff();
|
||||
|
||||
|
@ -218,12 +218,12 @@ void RunMod(void) {
|
||||
} else if (button_pressed == BUTTON_SINGLE_CLICK) {
|
||||
// Click - write ID to tag
|
||||
copy_em410x_to_t55xx(0
|
||||
, LF_CLOCK
|
||||
, (uint32_t)(em4100rwc_low[selected] >> 32)
|
||||
, (uint32_t)(em4100rwc_low[selected] & 0xffffffff)
|
||||
, false
|
||||
, true
|
||||
);
|
||||
, LF_CLOCK
|
||||
, (uint32_t)(em4100rwc_low[selected] >> 32)
|
||||
, (uint32_t)(em4100rwc_low[selected] & 0xffffffff)
|
||||
, false
|
||||
, true
|
||||
);
|
||||
led_slot(selected);
|
||||
state = 0; // Switch to select mode
|
||||
}
|
||||
|
@ -2450,10 +2450,10 @@ int copy_em410x_to_t55xx(uint8_t card, uint8_t clock, uint32_t id_hi, uint32_t i
|
||||
if (ledcontrol) LEDsoff();
|
||||
|
||||
Dbprintf("Tag %s written with 0x%08x%08x",
|
||||
card == 0 ? "T5555" : (card == 1 ? "T55x7" : "EM4x05"),
|
||||
(uint32_t)(id >> 32),
|
||||
(uint32_t)id
|
||||
);
|
||||
card == 0 ? "T5555" : (card == 1 ? "T55x7" : "EM4x05"),
|
||||
(uint32_t)(id >> 32),
|
||||
(uint32_t)id
|
||||
);
|
||||
|
||||
if (add_electra) {
|
||||
Dbprintf("Electra 0x%08x%08x\n", electra[0], electra[1]);
|
||||
|
@ -438,7 +438,7 @@ int mifare_ultra_aes_auth(uint8_t keyno, uint8_t *keybytes) {
|
||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x - expected 19 got " _RED_("%u"), resp[0], len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
memset(IV, 0, 16);
|
||||
mbedtls_aes_setkey_dec(&actx, key, 128);
|
||||
mbedtls_aes_crypt_cbc(&actx, MBEDTLS_AES_DECRYPT, sizeof(random_b), IV, resp + 1, random_b);
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#define HOOKKEY "_HKEY"
|
||||
|
||||
static void checkstack (lua_State *L, lua_State *L1, int n) {
|
||||
if (L != L1 && !lua_checkstack(L1, n))
|
||||
luaL_error(L, "stack overflow");
|
||||
static void checkstack(lua_State *L, lua_State *L1, int n) {
|
||||
if (L != L1 && !lua_checkstack(L1, n))
|
||||
luaL_error(L, "stack overflow");
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
static const char *getfuncname(lua_State *L, CallInfo *ci, const char **name);
|
||||
|
||||
static void swapextra (lua_State *L) {
|
||||
static void swapextra(lua_State *L) {
|
||||
if (L->status == LUA_YIELD) {
|
||||
CallInfo *ci = L->ci; /* get function that yielded */
|
||||
StkId temp = ci->func; /* exchange its 'func' and 'extra' values */
|
||||
@ -337,11 +337,11 @@ static void kname(Proto *p, int pc, int c, const char **name) {
|
||||
*name = "?"; /* no reasonable name found */
|
||||
}
|
||||
|
||||
static int filterpc (int pc, int jmptarget) {
|
||||
if (pc < jmptarget) /* is code conditional (inside a jump)? */
|
||||
return -1; /* cannot know who sets that register */
|
||||
else
|
||||
return pc; /* current position sets that register */
|
||||
static int filterpc(int pc, int jmptarget) {
|
||||
if (pc < jmptarget) /* is code conditional (inside a jump)? */
|
||||
return -1; /* cannot know who sets that register */
|
||||
else
|
||||
return pc; /* current position sets that register */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -350,7 +350,7 @@ static int filterpc (int pc, int jmptarget) {
|
||||
static int findsetreg(Proto *p, int lastpc, int reg) {
|
||||
int pc;
|
||||
int setreg = -1; /* keep last instruction that changed 'reg' */
|
||||
int jmptarget = 0; /* any code before this address is conditional */
|
||||
int jmptarget = 0; /* any code before this address is conditional */
|
||||
for (pc = 0; pc < lastpc; pc++) {
|
||||
Instruction i = p->code[pc];
|
||||
OpCode op = GET_OPCODE(i);
|
||||
|
@ -330,8 +330,7 @@ Cfunc:
|
||||
if (!p->is_vararg) {
|
||||
func = restorestack(L, funcr);
|
||||
base = func + 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
base = adjust_varargs(L, p, n);
|
||||
func = restorestack(L, funcr); /* previous call can change stack */
|
||||
}
|
||||
|
@ -506,9 +506,9 @@ static lu_mem traversestack(global_State *g, lua_State *th) {
|
||||
} else { /* count call infos to compute size */
|
||||
CallInfo *ci;
|
||||
for (ci = &th->base_ci; ci != th->ci; ci = ci->next)
|
||||
n++;
|
||||
n++;
|
||||
}
|
||||
return sizeof(lua_State) + sizeof(TValue) * th->stacksize + sizeof(CallInfo) * n;
|
||||
return sizeof(lua_State) + sizeof(TValue) * th->stacksize + sizeof(CallInfo) * n;
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,8 +41,8 @@ typedef struct {
|
||||
|
||||
local function calypso_parse(result)
|
||||
if result.Length >= 0 then
|
||||
local response_byte = string.sub(result.Data, 0, 1);
|
||||
local datalen = string.sub(result.Data, 2, 5);
|
||||
local response_byte = string.sub(result.Data, 0, 1);
|
||||
local datalen = string.sub(result.Data, 2, 5);
|
||||
local d = string.sub(result.Data, 6, datalen * 2);
|
||||
return {
|
||||
response_byte = response_byte,
|
||||
|
@ -33,8 +33,8 @@ device-side.
|
||||
-- iceman, todo: return payload from ISO14b APDU is a struct now. iso14b_raw_apdu_response_t
|
||||
local function mobib_parse(result)
|
||||
if result.Length >= 0 then
|
||||
local response_byte = string.sub(result.Data, 0, 1);
|
||||
local datalen = string.sub(result.Data, 2, 5);
|
||||
local response_byte = string.sub(result.Data, 0, 1);
|
||||
local datalen = string.sub(result.Data, 2, 5);
|
||||
local d = string.sub(result.Data, 6, datalen * 2);
|
||||
return {
|
||||
response_byte = response_byte,
|
||||
|
@ -3709,13 +3709,13 @@ static int CmdCryptography(const char *Cmd) {
|
||||
}
|
||||
|
||||
// Encrypt(0) or decrypt(1)?
|
||||
if ((type & 0x8) >> 3) {
|
||||
if ((type & 0x8) >> 3) {
|
||||
|
||||
if ((type & 0x4) >> 2) { // AES or DES?
|
||||
|
||||
if (keylen > 8) {
|
||||
|
||||
PrintAndLogEx(INFO, "Called 3DES decrypt");
|
||||
PrintAndLogEx(INFO, "Called 3DES decrypt");
|
||||
des3_decrypt(dato, dati, key, keylen / 8);
|
||||
|
||||
} else {
|
||||
@ -3728,8 +3728,8 @@ static int CmdCryptography(const char *Cmd) {
|
||||
des_decrypt_cbc(dato, dati, datilen, key, iv);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "Called AES decrypt");
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "Called AES decrypt");
|
||||
aes_decode(iv, key, dati, dato, datilen);
|
||||
}
|
||||
|
||||
@ -3766,7 +3766,7 @@ static int CmdCryptography(const char *Cmd) {
|
||||
PrintAndLogEx(INFO, "Called DES encrypt");
|
||||
|
||||
if (ivlen == 0) {
|
||||
// If there's an IV, use ECB
|
||||
// If there's an IV, use ECB
|
||||
des_encrypt_ecb(dato, dati, datilen, key);
|
||||
} else {
|
||||
des_encrypt_cbc(dato, dati, datilen, key, iv);
|
||||
@ -3780,8 +3780,8 @@ static int CmdCryptography(const char *Cmd) {
|
||||
} else {
|
||||
|
||||
if (type & 0x02) {
|
||||
PrintAndLogEx(INFO, "Called AES CMAC");
|
||||
// If we will calculate a MAC
|
||||
PrintAndLogEx(INFO, "Called AES CMAC");
|
||||
// If we will calculate a MAC
|
||||
aes_cmac8(iv, key, dati, dato, datilen);
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "Called AES encrypt");
|
||||
@ -3860,7 +3860,7 @@ static int CmdBinaryMap(const char *Cmd) {
|
||||
}
|
||||
|
||||
static command_t CommandTable[] = {
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "------------------------- " _CYAN_("General") "-------------------------"},
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "------------------------- " _CYAN_("General") "-------------------------"},
|
||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "------------------------- " _CYAN_("Modulation") "-------------------------"},
|
||||
{"biphaserawdecode", CmdBiphaseDecodeRaw, AlwaysAvailable, "Biphase decode bin stream in DemodBuffer"},
|
||||
|
@ -87,12 +87,12 @@ static int derive_app_key(uint8_t *uid, uint8_t *app_key) {
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
|
||||
/*
|
||||
c = b'\x88' + uid
|
||||
ch, cl = c[0:4], c[4:8]
|
||||
payload = (ch + cl + cl + ch) * 2
|
||||
AES.new(ICT_DESFIRE_MASTER_APPKEY, AES.MODE_CBC, iv=b'\0'*16).decrypt(payload)[16:]
|
||||
*/
|
||||
/*
|
||||
c = b'\x88' + uid
|
||||
ch, cl = c[0:4], c[4:8]
|
||||
payload = (ch + cl + cl + ch) * 2
|
||||
AES.new(ICT_DESFIRE_MASTER_APPKEY, AES.MODE_CBC, iv=b'\0'*16).decrypt(payload)[16:]
|
||||
*/
|
||||
uint8_t input[] = {0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
memcpy(input + 1, uid, 7);
|
||||
|
||||
@ -105,16 +105,16 @@ static int derive_app_key(uint8_t *uid, uint8_t *app_key) {
|
||||
|
||||
uint8_t iv[16] = {0};
|
||||
mbedtls_aes_context aes;
|
||||
mbedtls_aes_init(&aes);
|
||||
mbedtls_aes_init(&aes);
|
||||
if (mbedtls_aes_setkey_enc(&aes, key, 128)) {
|
||||
return PM3_ESOFT;
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
uint8_t output[8];
|
||||
if (mbedtls_aes_crypt_cbc(&aes, MBEDTLS_AES_DECRYPT, sizeof(input), iv, input, output)) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
mbedtls_aes_free(&aes);
|
||||
mbedtls_aes_free(&aes);
|
||||
memcpy(app_key, output, sizeof(output));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
@ -133,21 +133,21 @@ static int diversify_mifare_key(uint8_t *uid, uint8_t *app_key) {
|
||||
num_to_bytes(big, 4, input + 4);
|
||||
|
||||
uint8_t key[AES_KEY_LEN];
|
||||
memset(key, 0 , sizeof(key));
|
||||
memset(key, 0, sizeof(key));
|
||||
// memcpy(key, ICT_DESFIRE_FILEKEY, AES_KEY_LEN);
|
||||
|
||||
uint8_t iv[16] = {0};
|
||||
mbedtls_aes_context aes;
|
||||
mbedtls_aes_init(&aes);
|
||||
mbedtls_aes_init(&aes);
|
||||
if (mbedtls_aes_setkey_enc(&aes, key, 128)) {
|
||||
return PM3_ESOFT;
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
uint8_t output[8];
|
||||
if (mbedtls_aes_crypt_cbc(&aes, MBEDTLS_AES_DECRYPT, sizeof(input), iv, input, output)) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
mbedtls_aes_free(&aes);
|
||||
mbedtls_aes_free(&aes);
|
||||
memcpy(app_key, output, sizeof(output));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
@ -165,16 +165,16 @@ static int decrypt_card_sector(uint8_t *uid, uint8_t *sector_data, uint8_t len,
|
||||
|
||||
uint8_t iv[16] = {0};
|
||||
mbedtls_aes_context aes;
|
||||
mbedtls_aes_init(&aes);
|
||||
mbedtls_aes_init(&aes);
|
||||
if (mbedtls_aes_setkey_enc(&aes, key, 128)) {
|
||||
return PM3_ESOFT;
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
uint8_t output[len];
|
||||
if (mbedtls_aes_crypt_cbc(&aes, MBEDTLS_AES_DECRYPT, sizeof(input), iv, input, output)) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
mbedtls_aes_free(&aes);
|
||||
mbedtls_aes_free(&aes);
|
||||
|
||||
memcpy(plain, output, sizeof(output));
|
||||
return PM3_SUCCESS;
|
||||
@ -184,11 +184,11 @@ static int derive_mifare_key(uint8_t *uid, const uint8_t *base_key, uint8_t *app
|
||||
if (uid == NULL || base_key == NULL || app_key == NULL) {
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
|
||||
|
||||
uint8_t diverse[MIFARE_KEY_SIZE];
|
||||
diversify_mifare_key(uid, diverse);
|
||||
|
||||
for (uint8_t i=0; i < MIFARE_KEY_SIZE; i++) {
|
||||
for (uint8_t i = 0; i < MIFARE_KEY_SIZE; i++) {
|
||||
app_key[i] = base_key[i] ^ diverse[i];
|
||||
}
|
||||
|
||||
@ -204,10 +204,10 @@ static int derive_mifare_key_b(uint8_t *uid, uint8_t *app_key) {
|
||||
}
|
||||
|
||||
static int decrypt_card_file(uint8_t *card_file, uint8_t len, uint8_t *plain) {
|
||||
if (card_file == NULL || plain == NULL) {
|
||||
if (card_file == NULL || plain == NULL) {
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
|
||||
|
||||
uint8_t input[ICT_FILE_SIZE];
|
||||
memcpy(input, card_file, len);
|
||||
|
||||
@ -216,11 +216,11 @@ static int decrypt_card_file(uint8_t *card_file, uint8_t len, uint8_t *plain) {
|
||||
|
||||
uint8_t iv[16] = {0};
|
||||
mbedtls_aes_context aes;
|
||||
mbedtls_aes_init(&aes);
|
||||
mbedtls_aes_init(&aes);
|
||||
if (mbedtls_aes_setkey_enc(&aes, key, 128)) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
uint8_t output[ICT_FILE_SIZE];
|
||||
if (mbedtls_aes_crypt_cbc(&aes, MBEDTLS_AES_DECRYPT, ICT_FILE_SIZE, iv, input, output)) {
|
||||
return PM3_ESOFT;
|
||||
@ -248,16 +248,16 @@ static int encrypt_card_file(uint8_t *card_file, uint8_t len, bool padding, uint
|
||||
|
||||
uint8_t iv[16] = {0};
|
||||
mbedtls_aes_context aes;
|
||||
mbedtls_aes_init(&aes);
|
||||
mbedtls_aes_init(&aes);
|
||||
if (mbedtls_aes_setkey_enc(&aes, key, 128)) {
|
||||
return PM3_ESOFT;
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
uint8_t output[ICT_FILE_SIZE];
|
||||
if (mbedtls_aes_crypt_cbc(&aes, MBEDTLS_AES_ENCRYPT, ICT_FILE_SIZE, iv, input, output)) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
mbedtls_aes_free(&aes);
|
||||
mbedtls_aes_free(&aes);
|
||||
memcpy(enc, output, sizeof(output));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
@ -266,56 +266,56 @@ static void itc_decode_card_blob(uint8_t *data, uint8_t card_type) {
|
||||
if (data == NULL) {
|
||||
return;
|
||||
}
|
||||
/*
|
||||
uint8_t block[16];
|
||||
if (card_type == ICT_CT_NFC)
|
||||
memcpy(block, data+16, sizeof(block));
|
||||
else
|
||||
memcpy(block, data, sizeof(block));
|
||||
/*
|
||||
uint8_t block[16];
|
||||
if (card_type == ICT_CT_NFC)
|
||||
memcpy(block, data+16, sizeof(block));
|
||||
else
|
||||
memcpy(block, data, sizeof(block));
|
||||
|
||||
uint8_t bit_count = data[8];
|
||||
uint8_t bit_count = data[8];
|
||||
|
||||
uint8_t wiegand[32];
|
||||
uint8_t wiegand[32];
|
||||
|
||||
if (card_type == ICT_CT_DESFIRE || card_type == ICT_CT_NFC) {
|
||||
memcpy(wiegand, data + 11, 32-11);
|
||||
}
|
||||
if (card_type == ICT_CT_DESFIRE || card_type == ICT_CT_NFC) {
|
||||
memcpy(wiegand, data + 11, 32-11);
|
||||
}
|
||||
|
||||
if (card_type == ICT_CT_CLASSIC) {
|
||||
memcpy(wiegand, data + 9, 32-9);
|
||||
}
|
||||
if (card_type == ICT_CT_CLASSIC) {
|
||||
memcpy(wiegand, data + 9, 32-9);
|
||||
}
|
||||
|
||||
if (bit_count == 26) {
|
||||
fc, cn = decode_wiegand_26(wiegand_payload)
|
||||
ct = "Wiegand 26-bit"
|
||||
}
|
||||
if (bit_count == 34) {
|
||||
fc, cn = decode_wiegand_34(wiegand_payload)
|
||||
ct = "Wiegand 34-bit"
|
||||
}else {
|
||||
return f"Unknown format (bitlength={bit_count})", None, None
|
||||
}
|
||||
if (bit_count == 26) {
|
||||
fc, cn = decode_wiegand_26(wiegand_payload)
|
||||
ct = "Wiegand 26-bit"
|
||||
}
|
||||
if (bit_count == 34) {
|
||||
fc, cn = decode_wiegand_34(wiegand_payload)
|
||||
ct = "Wiegand 34-bit"
|
||||
}else {
|
||||
return f"Unknown format (bitlength={bit_count})", None, None
|
||||
}
|
||||
|
||||
return ct, fc, cn
|
||||
*/
|
||||
return ct, fc, cn
|
||||
*/
|
||||
}
|
||||
static void itc_encode_card_blob(uint8_t facility_code, uint16_t card_number, uint8_t bit_count) {
|
||||
/*
|
||||
// encode wiegand ..
|
||||
uint8_t wiegand[] = {0,0,0,0,0};
|
||||
if (bit_count == 26) {
|
||||
// wiegand_data = encode_wiegand_26(facility_code, card_number)
|
||||
}
|
||||
if (bit_count == 34) {
|
||||
// wiegand_data = encode_wiegand_34(facility_code, card_number)
|
||||
}
|
||||
/*
|
||||
// encode wiegand ..
|
||||
uint8_t wiegand[] = {0,0,0,0,0};
|
||||
if (bit_count == 26) {
|
||||
// wiegand_data = encode_wiegand_26(facility_code, card_number)
|
||||
}
|
||||
if (bit_count == 34) {
|
||||
// wiegand_data = encode_wiegand_34(facility_code, card_number)
|
||||
}
|
||||
|
||||
// card binary blog
|
||||
uint8_t blob[] = {
|
||||
'@', 'I', 'C', 'T', 0x00, 0x80, 0x00, 0x00, bit_count, 0x00, bit_count
|
||||
};
|
||||
// return b'@ICT' + bytes([0,128,0,0,bit_count, 0, bit_count]) + wiegand_data
|
||||
*/
|
||||
// card binary blog
|
||||
uint8_t blob[] = {
|
||||
'@', 'I', 'C', 'T', 0x00, 0x80, 0x00, 0x00, bit_count, 0x00, bit_count
|
||||
};
|
||||
// return b'@ICT' + bytes([0,128,0,0,bit_count, 0, bit_count]) + wiegand_data
|
||||
*/
|
||||
}
|
||||
|
||||
static int ict_select(void) {
|
||||
@ -463,13 +463,13 @@ static int CmdHfIctRead(const char *Cmd) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static int CmdHfIctCredential(const char * Cmd) {
|
||||
static int CmdHfIctCredential(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf ict credential",
|
||||
"Read ICT sector from tag and decode",
|
||||
"hf ict credential\n"
|
||||
);
|
||||
"Read ICT sector from tag and decode",
|
||||
"hf ict credential\n"
|
||||
);
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_lit0("v", "verbose", "verbose output"),
|
||||
@ -491,14 +491,14 @@ static int CmdHfIctCredential(const char * Cmd) {
|
||||
if ((card.sak & 0x24) == 0x24) {
|
||||
isdesfire = true;
|
||||
} else if ((card.sak & 0x20) == 0x20) {
|
||||
if (card.atqa[0] == 0x003&& card.atqa[1] == 0x40) {
|
||||
if (card.atqa[0] == 0x003 && card.atqa[1] == 0x40) {
|
||||
isdesfire = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isdesfire) {
|
||||
|
||||
// read file in desfire application
|
||||
// read file in desfire application
|
||||
// add decrypt sector
|
||||
|
||||
} else {
|
||||
@ -510,7 +510,7 @@ static int CmdHfIctCredential(const char * Cmd) {
|
||||
}
|
||||
|
||||
// diversified key A?
|
||||
int res = mfReadSector(ICT_MIFARE_SECTOR, MF_KEY_A, ICT_MIFARE_A_KEY, data);
|
||||
int res = mfReadSector(ICT_MIFARE_SECTOR, MF_KEY_A, ICT_MIFARE_A_KEY, data);
|
||||
if (res != PM3_SUCCESS) {
|
||||
free(data);
|
||||
return res;
|
||||
|
@ -9344,7 +9344,7 @@ static int CmdHF14AMfInfo(const char *Cmd) {
|
||||
|
||||
if (e_sector[1].foundKey[MF_KEY_A] && (e_sector[1].Key[MF_KEY_A] == 0x2A2C13CC242A)) {
|
||||
PrintAndLogEx(SUCCESS, "Dorma Kaba SAFLOK detected");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "<N/A>");
|
||||
|
@ -336,7 +336,7 @@ static int ulaes_requestAuthentication(uint8_t *key, uint8_t keyno, bool switch_
|
||||
memcpy(payload.key, key, sizeof(payload.key));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_MIFAREULAES_AUTH, (uint8_t*)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_HF_MIFAREULAES_AUTH, (uint8_t *)&payload, sizeof(payload));
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFAREULAES_AUTH, &resp, 1500) == false) {
|
||||
return PM3_ETIMEOUT;
|
||||
@ -456,7 +456,7 @@ static int try_default_3des_keys(bool override, uint8_t **correct_key) {
|
||||
|
||||
// param override, means we override hw debug levels.
|
||||
static int try_default_aes_keys(bool override) {
|
||||
|
||||
|
||||
uint8_t dbg_curr = DBG_NONE;
|
||||
if (override) {
|
||||
if (getDeviceDebugLevel(&dbg_curr) != PM3_SUCCESS) {
|
||||
@ -481,7 +481,7 @@ static int try_default_aes_keys(bool override) {
|
||||
if (ulaes_requestAuthentication(key, keyno, true) == PM3_SUCCESS) {
|
||||
|
||||
char keystr[20] = {0};
|
||||
switch(keyno) {
|
||||
switch (keyno) {
|
||||
case 0:
|
||||
sprintf(keystr, "Data key");
|
||||
break;
|
||||
@ -495,10 +495,10 @@ static int try_default_aes_keys(bool override) {
|
||||
break;
|
||||
}
|
||||
PrintAndLogEx(SUCCESS, "%02X " _YELLOW_("%s") " - %s ( "_GREEN_("ok") " )"
|
||||
, keyno
|
||||
, keystr
|
||||
, sprint_hex_inrow(key, 16)
|
||||
);
|
||||
, keyno
|
||||
, keystr
|
||||
, sprint_hex_inrow(key, 16)
|
||||
);
|
||||
|
||||
res = PM3_SUCCESS;
|
||||
}
|
||||
@ -1586,7 +1586,7 @@ static mfu_otp_identify_t *mfu_match_otp_fingerprint(uint8_t *uid, uint8_t *data
|
||||
PrintAndLogEx(DEBUG, "uid.... %s", sprint_hex_inrow(uid, 7));
|
||||
PrintAndLogEx(DEBUG, "calc... %s", sprint_hex_inrow(mtmp, 4));
|
||||
PrintAndLogEx(DEBUG, "dump... %s", sprint_hex_inrow(data + mfu_otp_ident_table[i].mpos, min));
|
||||
|
||||
|
||||
bool m2 = (memcmp(mtmp, data + mfu_otp_ident_table[i].mpos, min) == 0);
|
||||
if (m2) {
|
||||
PrintAndLogEx(DEBUG, "(fingerprint) found %s", mfu_otp_ident_table[i].desc);
|
||||
@ -1781,12 +1781,12 @@ static int mfu_fingerprint(uint64_t tagtype, bool hasAuthKey, uint8_t *authkey,
|
||||
|
||||
if (getDeviceDebugLevel(&dbg_curr) != PM3_SUCCESS) {
|
||||
res = PM3_ESOFT;
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (setDeviceDebugLevel(DBG_NONE, false) != PM3_SUCCESS) {
|
||||
res = PM3_ESOFT;
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
@ -2958,7 +2958,7 @@ static int CmdHF14AMfUDump(const char *Cmd) {
|
||||
if (setDeviceDebugLevel(DBG_NONE, false) != PM3_SUCCESS) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HF_MIFAREU_READCARD, start_page, pages, keytype, authKeyPtr, ak_len);
|
||||
PacketResponseNG resp;
|
||||
@ -3071,7 +3071,7 @@ static int CmdHF14AMfUDump(const char *Cmd) {
|
||||
ulev1_readSignature(get_signature, sizeof(get_signature));
|
||||
DropField();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// format and add keys to block dump output
|
||||
// only add keys if not partial read, and complete pages read
|
||||
|
@ -99,13 +99,13 @@ static void print_st25ta_system_info(uint8_t *d, uint8_t n) {
|
||||
if (d[2] == 0x80) {
|
||||
PrintAndLogEx(SUCCESS, " ....%02X.............................. - ST reserved", d[2]);
|
||||
} else {
|
||||
PrintAndLogEx(SUCCESS, " ....%02X.............................. - GPO config" , d[2]);
|
||||
PrintAndLogEx(SUCCESS, " ....%02X.............................. - GPO config", d[2]);
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, " ......%02X............................ - Event counter config", d[3]);
|
||||
|
||||
uint32_t counter = (d[4] << 16 | d[5] << 8 | d[6]);
|
||||
PrintAndLogEx(SUCCESS, " ........%02X%02X%02X...................... - 20 bit counter ( %u )", d[4],d[5],d[6], (counter & 0xFFFFF));
|
||||
PrintAndLogEx(SUCCESS, " ........%02X%02X%02X...................... - 20 bit counter ( %u )", d[4], d[5], d[6], (counter & 0xFFFFF));
|
||||
PrintAndLogEx(SUCCESS, " ..............%02X.................... - Product version", d[7]);
|
||||
PrintAndLogEx(SUCCESS, " ................%s...... - UID", sprint_hex_inrow(d + 8, 7));
|
||||
|
||||
|
@ -2597,7 +2597,7 @@ static int CmdEM4x05Config(const char *Cmd) {
|
||||
static command_t CommandTable[] = {
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "----------------------- " _CYAN_("General") " -----------------------"},
|
||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "----------------------- " _CYAN_("Operations") " -----------------------"},
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "----------------------- " _CYAN_("Operations") " -----------------------"},
|
||||
{"brute", CmdEM4x05Brute, IfPm3Lf, "Bruteforce password"},
|
||||
{"chk", CmdEM4x05Chk, IfPm3Lf, "Check passwords from dictionary"},
|
||||
{"config", CmdEM4x05Config, AlwaysAvailable, "Create common configuration words"},
|
||||
|
@ -1305,12 +1305,12 @@ static int CmdPCSC(const char *Cmd) {
|
||||
uint8_t atr[50] = {0};
|
||||
int atrLen = 0;
|
||||
|
||||
switch(card_type) {
|
||||
switch (card_type) {
|
||||
case CC_CONTACT: {
|
||||
memcpy(atr, card.atr, card.atr_len);
|
||||
atrLen = card.atr_len;
|
||||
break;
|
||||
}
|
||||
}
|
||||
case CC_CONTACTLESS: {
|
||||
|
||||
if (cl_proto == ISODEP_NFCA) {
|
||||
@ -1335,7 +1335,7 @@ static int CmdPCSC(const char *Cmd) {
|
||||
mbedtls_net_send(&netCtx, res, 2 + atrLen);
|
||||
|
||||
} else if (cmdbuf[1] != 0x01) { // vpcd APDU
|
||||
int apduLen = (cmdbuf[0] << 8)+ cmdbuf[1];
|
||||
int apduLen = (cmdbuf[0] << 8) + cmdbuf[1];
|
||||
|
||||
uint8_t apduRes[APDU_RES_LEN] = {0};
|
||||
int apduResLen = 0;
|
||||
@ -1361,9 +1361,9 @@ static int CmdPCSC(const char *Cmd) {
|
||||
mbedtls_net_close(&netCtx);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cl_proto == ISODEP_NFCB) {
|
||||
|
||||
|
||||
if (exchange_14b_apdu(cmdbuf + 2, apduLen, !field_activated, true, apduRes, sizeof(apduRes), &apduResLen, 0)) {
|
||||
have_card = false;
|
||||
mbedtls_net_close(&netCtx);
|
||||
@ -1373,14 +1373,14 @@ static int CmdPCSC(const char *Cmd) {
|
||||
if (cl_proto == ISODEP_NFCV) {
|
||||
// Not implemented
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
field_activated = true;
|
||||
|
||||
if (verbose) {
|
||||
@ -1407,7 +1407,7 @@ static int CmdPCSC(const char *Cmd) {
|
||||
card_type = CC_CONTACTLESS;
|
||||
cl_proto = ISODEP_NFCB;
|
||||
}
|
||||
|
||||
|
||||
// ISO 15.
|
||||
|
||||
if (use_contact && IfPm3Iso14443() && smart_select(false, &card) == PM3_SUCCESS) {
|
||||
|
@ -431,17 +431,17 @@ const static vocabulary_t vocabulary[] = {
|
||||
{ 0, "hf mfu setuid" },
|
||||
{ 0, "hf mfu amiibo" },
|
||||
{ 1, "hf mfdes help" },
|
||||
{ 0, "hf mfdes info" },
|
||||
{ 0, "hf mfdes getuid" },
|
||||
{ 0, "hf mfdes default" },
|
||||
{ 1, "hf mfdes list" },
|
||||
{ 0, "hf mfdes auth" },
|
||||
{ 0, "hf mfdes chk" },
|
||||
{ 0, "hf mfdes default" },
|
||||
{ 0, "hf mfdes detect" },
|
||||
{ 0, "hf mfdes freemem" },
|
||||
{ 0, "hf mfdes setconfig" },
|
||||
{ 0, "hf mfdes formatpicc" },
|
||||
{ 1, "hf mfdes list" },
|
||||
{ 0, "hf mfdes freemem" },
|
||||
{ 0, "hf mfdes getuid" },
|
||||
{ 0, "hf mfdes info" },
|
||||
{ 0, "hf mfdes mad" },
|
||||
{ 0, "hf mfdes setconfig" },
|
||||
{ 0, "hf mfdes lsapp" },
|
||||
{ 0, "hf mfdes getaids" },
|
||||
{ 0, "hf mfdes getappnames" },
|
||||
@ -814,13 +814,13 @@ const static vocabulary_t vocabulary[] = {
|
||||
{ 1, "piv list" },
|
||||
{ 1, "smart help" },
|
||||
{ 1, "smart list" },
|
||||
{ 0, "smart brute" },
|
||||
{ 0, "smart info" },
|
||||
{ 0, "smart relay" },
|
||||
{ 1, "smart pcsc" },
|
||||
{ 0, "smart reader" },
|
||||
{ 0, "smart raw" },
|
||||
{ 1, "smart upgrade" },
|
||||
{ 0, "smart setclock" },
|
||||
{ 0, "smart brute" },
|
||||
{ 1, "script help" },
|
||||
{ 1, "script list" },
|
||||
{ 1, "script run" },
|
||||
|
@ -444,7 +444,7 @@
|
||||
},
|
||||
"data help": {
|
||||
"command": "data help",
|
||||
"description": "help This help ----------- ------------------------- Modulation------------------------- biphaserawdecode Biphase decode bin stream in DemodBuffer detectclock Detect ASK, FSK, NRZ, PSK clock rate of wave in GraphBuffer fsktonrz Convert fsk2 to nrz wave for alternate fsk demodulating (for weak fsk) manrawdecode Manchester decode binary stream in DemodBuffer modulation Identify LF signal for clock and modulation rawdemod Demodulate the data in the GraphBuffer and output binary ----------- ------------------------- Graph------------------------- askedgedetect Adjust Graph for manual ASK demod autocorr Autocorrelation over window dirthreshold Max rising higher up-thres/ Min falling lower down-thres decimate Decimate samples envelope Generate square envelope of samples undecimate Un-decimate samples hide Hide graph window hpf Remove DC offset from trace iir Apply IIR buttersworth filter on plot data grid overlay grid on graph window ltrim Trim samples from left of trace mtrim Trim out samples from the specified start to the specified stop norm Normalize max/min to +/-128 plot Show graph window cthreshold Average out all values between rtrim Trim samples from right of trace setgraphmarkers Set blue and orange marker in graph window shiftgraphzero Shift 0 for Graphed wave + or - shift value timescale Set cursor display timescale zerocrossings Count time between zero-crossings convertbitstream Convert GraphBuffer's 0/1 values to 127 / -127 getbitstream Convert GraphBuffer's >=1 values to 1 and <1 to 0 ----------- ------------------------- General------------------------- asn1 ASN1 decoder atr ATR lookup bin2hex Converts binary to hexadecimal bmap Convert hex value according a binary template clear Clears bigbuf on deviceside and graph window crypto Encrypt and decrypt data diff Diff of input files hex2bin Converts hexadecimal to binary load Load contents of file into graph window num Converts dec/hex/bin print Print the data in the DemodBuffer save Save signal trace data (from graph window) setdebugmode Set Debugging Level on client side --------------------------------------------------------------------------------------- data biphaserawdecode available offline: yes Biphase decode binary stream in DemodBuffer Converts 10 or 01 -> 1 and 11 or 00 -> 0 - must have binary sequence in DemodBuffer (run `data rawdemod --ar` before) - invert for Conditional Dephase Encoding (CDP) AKA Differential Manchester",
|
||||
"description": "----------- ------------------------- General------------------------- help This help ----------- ------------------------- Modulation------------------------- biphaserawdecode Biphase decode bin stream in DemodBuffer detectclock Detect ASK, FSK, NRZ, PSK clock rate of wave in GraphBuffer fsktonrz Convert fsk2 to nrz wave for alternate fsk demodulating (for weak fsk) manrawdecode Manchester decode binary stream in DemodBuffer modulation Identify LF signal for clock and modulation rawdemod Demodulate the data in the GraphBuffer and output binary ----------- ------------------------- Graph------------------------- askedgedetect Adjust Graph for manual ASK demod autocorr Autocorrelation over window dirthreshold Max rising higher up-thres/ Min falling lower down-thres decimate Decimate samples envelope Generate square envelope of samples undecimate Un-decimate samples hide Hide graph window hpf Remove DC offset from trace iir Apply IIR buttersworth filter on plot data grid overlay grid on graph window ltrim Trim samples from left of trace mtrim Trim out samples from the specified start to the specified stop norm Normalize max/min to +/-128 plot Show graph window cthreshold Average out all values between rtrim Trim samples from right of trace setgraphmarkers Set blue and orange marker in graph window shiftgraphzero Shift 0 for Graphed wave + or - shift value timescale Set cursor display timescale zerocrossings Count time between zero-crossings convertbitstream Convert GraphBuffer's 0/1 values to 127 / -127 getbitstream Convert GraphBuffer's >=1 values to 1 and <1 to 0 ----------- ------------------------- Operations------------------------- asn1 ASN1 decoder atr ATR lookup bin2hex Converts binary to hexadecimal bmap Convert hex value according a binary template clear Clears bigbuf on deviceside and graph window crypto Encrypt and decrypt data diff Diff of input files hex2bin Converts hexadecimal to binary load Load contents of file into graph window num Converts dec/hex/bin print Print the data in the DemodBuffer save Save signal trace data (from graph window) setdebugmode Set Debugging Level on client side --------------------------------------------------------------------------------------- data biphaserawdecode available offline: yes Biphase decode binary stream in DemodBuffer Converts 10 or 01 -> 1 and 11 or 00 -> 0 - must have binary sequence in DemodBuffer (run `data rawdemod --ar` before) - invert for Conditional Dephase Encoding (CDP) AKA Differential Manchester",
|
||||
"notes": [
|
||||
"data biphaserawdecode -> decode biphase bitstream from the DemodBuffer",
|
||||
"data biphaserawdecode -oi -> decode biphase bitstream from the DemodBuffer, adjust offset, and invert output"
|
||||
@ -903,7 +903,7 @@
|
||||
},
|
||||
"emv help": {
|
||||
"command": "emv help",
|
||||
"description": "----------- ----------------------- general ----------------------- help This help list List ISO7816 history test Crypto logic test --------------------------------------------------------------------------------------- emv list available offline: yes Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "----------- ----------------------- General ----------------------- help This help list List ISO7816 history test Crypto logic selftest --------------------------------------------------------------------------------------- emv list available offline: yes Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"emv list --frame -> show frame delay times",
|
||||
"emv list -1 -> use trace buffer"
|
||||
@ -1423,7 +1423,7 @@
|
||||
},
|
||||
"hf 14b help": {
|
||||
"command": "hf 14b help",
|
||||
"description": "help This help list List ISO-14443-B history --------- ----------------------- general ----------------------- view Display content from tag dump file valid SRIX4 checksum test --------------------------------------------------------------------------------------- hf 14b list available offline: yes Alias of `trace list -t 14b -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "--------- ----------------------- General ----------------------- help This help list List ISO-14443-B history --------- ----------------------- Operations ----------------------- view Display content from tag dump file valid SRIX4 checksum test --------------------------------------------------------------------------------------- hf 14b list available offline: yes Alias of `trace list -t 14b -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf 14b list --frame -> show frame delay times",
|
||||
"hf 14b list -1 -> use trace buffer"
|
||||
@ -1702,7 +1702,7 @@
|
||||
},
|
||||
"hf 15 help": {
|
||||
"command": "hf 15 help",
|
||||
"description": "help This help list List ISO-15693 history ----------- ----------------------- general ----------------------- demod Demodulate ISO-15693 from tag view Display content from tag dump file --------------------------------------------------------------------------------------- hf 15 list available offline: yes Alias of `trace list -t 15 -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "----------- ----------------------- General ----------------------- help This help list List ISO-15693 history ----------- ----------------------- Operations ----------------------- demod Demodulate ISO-15693 from tag view Display content from tag dump file --------------------------------------------------------------------------------------- hf 15 list available offline: yes Alias of `trace list -t 15 -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf 15 list --frame -> show frame delay times",
|
||||
"hf 15 list -1 -> use trace buffer"
|
||||
@ -2531,7 +2531,7 @@
|
||||
},
|
||||
"hf felica help": {
|
||||
"command": "hf felica help",
|
||||
"description": "help This help list List ISO 18092/FeliCa history ----------- ----------------------- General ----------------------- ----------- ----------------------- FeliCa Standard ----------------------- ----------- ----------------------- FeliCa Light ----------------------- --------------------------------------------------------------------------------------- hf felica list available offline: yes Alias of `trace list -t felica` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "----------- ----------------------- General ----------------------- help This help list List ISO 18092/FeliCa history ----------- ----------------------- Operations ----------------------- ----------- ----------------------- FeliCa Standard ----------------------- ----------- ----------------------- FeliCa Light ----------------------- --------------------------------------------------------------------------------------- hf felica list available offline: yes Alias of `trace list -t felica` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf felica list --frame -> show frame delay times",
|
||||
"hf felica list -1 -> use trace buffer"
|
||||
@ -3309,7 +3309,7 @@
|
||||
},
|
||||
"hf iclass help": {
|
||||
"command": "hf iclass help",
|
||||
"description": "help This help list List iclass history ----------- --------------------- general --------------------- view Display content from tag dump file ----------- --------------------- recovery -------------------- loclass Use loclass to perform bruteforce reader attack lookup Uses authentication trace to check for key in dictionary file ----------- ---------------------- utils ---------------------- calcnewkey Calc diversified keys (blocks 3 & 4) to write new keys encode Encode binary wiegand to block 7 encrypt Encrypt given block data decrypt Decrypt given block data or tag dump file managekeys Manage keys to use with iclass commands permutekey Permute function from 'heart of darkness' paper --------------------------------------------------------------------------------------- hf iclass list available offline: yes Alias of `trace list -t iclass -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "----------- --------------------- General --------------------- help This help list List iclass history view Display content from tag dump file ----------- --------------------- Recovery -------------------- loclass Use loclass to perform bruteforce reader attack lookup Uses authentication trace to check for key in dictionary file ----------- ---------------------- Utils ---------------------- calcnewkey Calc diversified keys (blocks 3 & 4) to write new keys encode Encode binary wiegand to block 7 encrypt Encrypt given block data decrypt Decrypt given block data or tag dump file managekeys Manage keys to use with iclass commands permutekey Permute function from 'heart of darkness' paper --------------------------------------------------------------------------------------- hf iclass list available offline: yes Alias of `trace list -t iclass -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf iclass list --frame -> show frame delay times",
|
||||
"hf iclass list -1 -> use trace buffer"
|
||||
@ -6087,19 +6087,7 @@
|
||||
},
|
||||
"hf mfdes help": {
|
||||
"command": "hf mfdes help",
|
||||
"description": "help This help list List DESFire (ISO 14443A) history test Regression crypto tests --------------------------------------------------------------------------------------- hf mfdes info available offline: no Get info from MIFARE DESfire tags",
|
||||
"notes": [
|
||||
"hf mfdes info"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help"
|
||||
],
|
||||
"usage": "hf mfdes info [-h]"
|
||||
},
|
||||
"hf mfdes list": {
|
||||
"command": "hf mfdes list",
|
||||
"description": "Alias of `trace list -t des -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "help This help list List DESFire (ISO 14443A) history test Regression crypto tests --------------------------------------------------------------------------------------- hf mfdes list available offline: yes Alias of `trace list -t des -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf mfdes list --frame -> show frame delay times",
|
||||
"hf mfdes list -1 -> use trace buffer"
|
||||
@ -6118,6 +6106,18 @@
|
||||
],
|
||||
"usage": "hf mfdes list [-h1crux] [--frame] [-f <fn>]"
|
||||
},
|
||||
"hf mfdes info": {
|
||||
"command": "hf mfdes info",
|
||||
"description": "Get info from MIFARE DESfire tags",
|
||||
"notes": [
|
||||
"hf mfdes info"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help"
|
||||
],
|
||||
"usage": "hf mfdes info [-h]"
|
||||
},
|
||||
"hf mfdes lsapp": {
|
||||
"command": "hf mfdes lsapp",
|
||||
"description": "Show application list. Master key needs to be provided or flag --no-auth set (depend on cards settings).",
|
||||
@ -6839,7 +6839,7 @@
|
||||
},
|
||||
"hf mfu help": {
|
||||
"command": "hf mfu help",
|
||||
"description": "help This help list List MIFARE Ultralight / NTAG history keygen Generate 3DES MIFARE diversified keys pwdgen Generate pwd from known algos view Display content from tag dump file --------------------------------------------------------------------------------------- hf mfu list available offline: yes Alias of `trace list -t 14a -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "help This help list List MIFARE Ultralight / NTAG history keygen Generate DES/3DES/AES MIFARE diversified keys pwdgen Generate pwd from known algos view Display content from tag dump file --------------------------------------------------------------------------------------- hf mfu list available offline: yes Alias of `trace list -t 14a -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf 14a list --frame -> show frame delay times",
|
||||
"hf 14a list -1 -> use trace buffer"
|
||||
@ -6870,13 +6870,14 @@
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-k, --key <hex> Authentication key (UL-C 16 bytes, EV1/NTAG 4 bytes)",
|
||||
"-l Swap entered key's endianness"
|
||||
"-l Swap entered key's endianness",
|
||||
"--force override `hw dbg` settings"
|
||||
],
|
||||
"usage": "hf mfu info [-hl] [-k <hex>]"
|
||||
"usage": "hf mfu info [-hl] [-k <hex>] [--force]"
|
||||
},
|
||||
"hf mfu keygen": {
|
||||
"command": "hf mfu keygen",
|
||||
"description": "Set the 3DES key on MIFARE Ultralight-C tag.",
|
||||
"description": "Set the DES/3DES/AES key on MIFARE Ultralight-C tag.",
|
||||
"notes": [
|
||||
"hf mfu keygen -r",
|
||||
"hf mfu keygen --uid 11223344556677"
|
||||
@ -6885,9 +6886,10 @@
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-u, --uid <hex> <4|7> hex byte UID",
|
||||
"-r Read UID from tag"
|
||||
"-r Read UID from tag",
|
||||
"-b, --blk <dec> Block number"
|
||||
],
|
||||
"usage": "hf mfu keygen [-hr] [-u <hex>]"
|
||||
"usage": "hf mfu keygen [-hr] [-u <hex>] [-b <dec>]"
|
||||
},
|
||||
"hf mfu ndefread": {
|
||||
"command": "hf mfu ndefread",
|
||||
@ -7743,7 +7745,7 @@
|
||||
},
|
||||
"hf xerox help": {
|
||||
"command": "hf xerox help",
|
||||
"description": "help This help list List ISO-14443B history -------- ----------------------- general ----------------------- view Display content from tag dump file --------------------------------------------------------------------------------------- hf xerox list available offline: yes Alias of `trace list -t 14b -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "help This help list List ISO-14443B history -------- ----------------------- General ----------------------- view Display content from tag dump file --------------------------------------------------------------------------------------- hf xerox list available offline: yes Alias of `trace list -t 14b -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf 14b list --frame -> show frame delay times",
|
||||
"hf 14b list -1 -> use trace buffer"
|
||||
@ -7882,13 +7884,14 @@
|
||||
"command": "hw detectreader",
|
||||
"description": "Start to detect presences of reader field",
|
||||
"notes": [
|
||||
"hw detectreader",
|
||||
"hw detectreader -L"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-L, --LF detect low frequency 125/134 kHz",
|
||||
"-H, --HF detect high frequency 13.56 MHZ"
|
||||
"-L, --LF only detect low frequency 125/134 kHz",
|
||||
"-H, --HF only detect high frequency 13.56 MHZ"
|
||||
],
|
||||
"usage": "hw detectreader [-hLH]"
|
||||
},
|
||||
@ -8359,9 +8362,10 @@
|
||||
"--clk <dec> <16|32|40|64> clock (default 64)",
|
||||
"--id <hex> EM Tag ID number (5 hex bytes)",
|
||||
"--q5 optional - specify writing to Q5/T5555 tag",
|
||||
"--em optional - specify writing to EM4305/4469 tag"
|
||||
"--em optional - specify writing to EM4305/4469 tag",
|
||||
"--electra optional - add Electra blocks to tag"
|
||||
],
|
||||
"usage": "lf em 410x clone [-h] [--clk <dec>] --id <hex> [--q5] [--em]"
|
||||
"usage": "lf em 410x clone [-h] [--clk <dec>] --id <hex> [--q5] [--em] [--electra]"
|
||||
},
|
||||
"lf em 410x reader": {
|
||||
"command": "lf em 410x reader",
|
||||
@ -8488,7 +8492,7 @@
|
||||
},
|
||||
"lf em 4x05 help": {
|
||||
"command": "lf em 4x05 help",
|
||||
"description": "help This help ----------- ----------------------- general ----------------------- config Create common configuration words demod Demodulate a EM4x05/EM4x69 tag from the GraphBuffer sniff Attempt to recover em4x05 commands from sample buffer view Display content from tag dump file --------------------------------------------------------------------------------------- lf em 4x05 brute available offline: no This command tries to bruteforce the password of a EM4205/4305/4469/4569 The loop is running on device side, press Proxmark3 button to abort",
|
||||
"description": "----------- ----------------------- General ----------------------- help This help ----------- ----------------------- Operations ----------------------- config Create common configuration words demod Demodulate a EM4x05/EM4x69 tag from the GraphBuffer sniff Attempt to recover em4x05 commands from sample buffer view Display content from tag dump file --------------------------------------------------------------------------------------- lf em 4x05 brute available offline: no This command tries to bruteforce the password of a EM4205/4305/4469/4569 The loop is running on device side, press Proxmark3 button to abort",
|
||||
"notes": [
|
||||
"Note: if you get many false positives, change position on the antennalf em 4x05 brute",
|
||||
"lf em 4x05 brute -n 1 -> stop after first candidate found",
|
||||
@ -12145,7 +12149,7 @@
|
||||
},
|
||||
"smart help": {
|
||||
"command": "smart help",
|
||||
"description": "help This help list List ISO 7816 history upgrade Upgrade sim module firmware --------------------------------------------------------------------------------------- smart list available offline: yes Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "help This help list List ISO 7816 history pcsc Turn pm3 into pcsc reader and relay to host OS via vpcd upgrade Upgrade sim module firmware --------------------------------------------------------------------------------------- smart list available offline: yes Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"smart list --frame -> show frame delay times",
|
||||
"smart list -1 -> use trace buffer"
|
||||
@ -12177,6 +12181,27 @@
|
||||
],
|
||||
"usage": "smart info [-hv]"
|
||||
},
|
||||
"smart pcsc": {
|
||||
"command": "smart pcsc",
|
||||
"description": "Make pm3 available to host OS smartcard driver via vpcd to enable use with other software such as GlobalPlatform Pro",
|
||||
"notes": [
|
||||
"Requires the virtual smartcard daemon to be installed and running",
|
||||
"see https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html",
|
||||
"note:",
|
||||
"`-v` shows APDU transactions between OS and card"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"--host <str> vpcd socket host (default: localhost)",
|
||||
"-p, --port <int> vpcd socket port (default: 35963)",
|
||||
"-v, --verbose display APDU transactions between OS and card",
|
||||
"-a use ISO 14443A contactless interface",
|
||||
"-b use ISO 14443B contactless interface",
|
||||
"-c use ISO 7816 contact interface"
|
||||
],
|
||||
"usage": "smart pcsc [-hvabc] [--host <str>] [-p <int>]"
|
||||
},
|
||||
"smart raw": {
|
||||
"command": "smart raw",
|
||||
"description": "Sends raw bytes to card",
|
||||
@ -12212,24 +12237,6 @@
|
||||
],
|
||||
"usage": "smart reader [-hv]"
|
||||
},
|
||||
"smart relay": {
|
||||
"command": "smart relay",
|
||||
"description": "Make pm3 available to host OS smartcard driver via vpcd to enable use with other software such as GlobalPlatform Pro",
|
||||
"notes": [
|
||||
"Requires the virtual smartcard daemon to be installed and running",
|
||||
"see https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html",
|
||||
"note:",
|
||||
"`-v` shows APDU transactions between OS and card"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"--host <str> VPCD socket host (default: localhost)",
|
||||
"-p, --port <int> VPCD socket port (default: 35963)",
|
||||
"-v, --verbose Verbose output"
|
||||
],
|
||||
"usage": "smart relay [-hv] [--host <str>] [-p <int>]"
|
||||
},
|
||||
"smart setclock": {
|
||||
"command": "smart setclock",
|
||||
"description": "Set clock speed for smart card interface.",
|
||||
@ -12491,6 +12498,6 @@
|
||||
"metadata": {
|
||||
"commands_extracted": 721,
|
||||
"extracted_by": "PM3Help2JSON v1.00",
|
||||
"extracted_on": "2024-02-03T15:03:29"
|
||||
"extracted_on": "2024-02-16T20:57:06"
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ Check column "offline" for their availability.
|
||||
|------- |------- |-----------
|
||||
|`emv help `|Y |`This help`
|
||||
|`emv list `|Y |`List ISO7816 history`
|
||||
|`emv test `|Y |`Crypto logic test`
|
||||
|`emv test `|Y |`Crypto logic selftest`
|
||||
|`emv challenge `|N |`Generate challenge`
|
||||
|`emv exec `|N |`Executes EMV contactless transaction`
|
||||
|`emv genac `|N |`Generate ApplicationCryptogram`
|
||||
@ -598,7 +598,7 @@ Check column "offline" for their availability.
|
||||
|------- |------- |-----------
|
||||
|`hf mfu help `|Y |`This help`
|
||||
|`hf mfu list `|Y |`List MIFARE Ultralight / NTAG history`
|
||||
|`hf mfu keygen `|Y |`Generate 3DES MIFARE diversified keys`
|
||||
|`hf mfu keygen `|Y |`Generate DES/3DES/AES MIFARE diversified keys`
|
||||
|`hf mfu pwdgen `|Y |`Generate pwd from known algos`
|
||||
|`hf mfu otptear `|N |`Tear-off test on OTP bits`
|
||||
|`hf mfu cauth `|N |`Authentication - Ultralight-C`
|
||||
@ -626,17 +626,17 @@ Check column "offline" for their availability.
|
||||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`hf mfdes help `|Y |`This help`
|
||||
|`hf mfdes info `|N |`Tag information`
|
||||
|`hf mfdes getuid `|N |`Get uid from card`
|
||||
|`hf mfdes default `|N |`Set defaults for all the commands`
|
||||
|`hf mfdes list `|Y |`List DESFire (ISO 14443A) history`
|
||||
|`hf mfdes auth `|N |`MIFARE DesFire Authentication`
|
||||
|`hf mfdes chk `|N |`Check keys`
|
||||
|`hf mfdes default `|N |`Set defaults for all the commands`
|
||||
|`hf mfdes detect `|N |`Detect key type and tries to find one from the list`
|
||||
|`hf mfdes freemem `|N |`Get free memory size`
|
||||
|`hf mfdes setconfig `|N |`Set card configuration`
|
||||
|`hf mfdes formatpicc `|N |`Format PICC`
|
||||
|`hf mfdes list `|Y |`List DESFire (ISO 14443A) history`
|
||||
|`hf mfdes freemem `|N |`Get free memory size`
|
||||
|`hf mfdes getuid `|N |`Get uid from card`
|
||||
|`hf mfdes info `|N |`Tag information`
|
||||
|`hf mfdes mad `|N |`Prints MAD records / files from the card`
|
||||
|`hf mfdes setconfig `|N |`Set card configuration`
|
||||
|`hf mfdes lsapp `|N |`Show all applications with files list`
|
||||
|`hf mfdes getaids `|N |`Get Application IDs list`
|
||||
|`hf mfdes getappnames `|N |`Get Applications list`
|
||||
@ -1455,13 +1455,13 @@ Check column "offline" for their availability.
|
||||
|------- |------- |-----------
|
||||
|`smart help `|Y |`This help`
|
||||
|`smart list `|Y |`List ISO 7816 history`
|
||||
|`smart brute `|N |`Bruteforce SFI`
|
||||
|`smart info `|N |`Tag information`
|
||||
|`smart relay `|N |`Turn pm3 into pcsc reader and relay to host OS via vpcd`
|
||||
|`smart pcsc `|Y |`Turn pm3 into pcsc reader and relay to host OS via vpcd`
|
||||
|`smart reader `|N |`Act like an IS07816 reader`
|
||||
|`smart raw `|N |`Send raw hex data to tag`
|
||||
|`smart upgrade `|Y |`Upgrade sim module firmware`
|
||||
|`smart setclock `|N |`Set clock speed`
|
||||
|`smart brute `|N |`Bruteforce SFI`
|
||||
|
||||
|
||||
### script
|
||||
|
Loading…
x
Reference in New Issue
Block a user