diff --git a/client/src/cmddata.c b/client/src/cmddata.c index aaf6cd891..df05e9084 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -3626,7 +3626,7 @@ static int CmdCryptography(const char *Cmd) { aes256_decode(iv, key, dati, dato, datilen); PrintAndLogEx(INFO, "AES-256 decrypt... " _YELLOW_("%s"), sprint_hex_inrow(dato, datilen)); } else { - aes_decode(iv, key, dati, dato, datilen); + aes_decode(iv, key, dati, dato, datilen); PrintAndLogEx(INFO, "AES-128 decrypt... " _YELLOW_("%s"), sprint_hex_inrow(dato, datilen)); } } @@ -3659,7 +3659,7 @@ static int CmdCryptography(const char *Cmd) { if (keylen > 8) { des3_encrypt(dato, dati, key, keylen / 8); - PrintAndLogEx(INFO, "3DES encrypt keysize ( %d )... " _YELLOW_("%s"), (keylen / 8), sprint_hex_inrow(dato, datilen)); + PrintAndLogEx(INFO, "3DES encrypt keysize ( %d )... " _YELLOW_("%s"), (keylen / 8), sprint_hex_inrow(dato, datilen)); } else { if (ivlen == 0) { @@ -3687,13 +3687,13 @@ static int CmdCryptography(const char *Cmd) { aes256_encode(iv, key, dati, dato, datilen); PrintAndLogEx(INFO, "AES-256 encrypt... " _YELLOW_("%s"), sprint_hex_inrow(dato, datilen)); } else { - aes_encode(iv, key, dati, dato, datilen); + aes_encode(iv, key, dati, dato, datilen); PrintAndLogEx(INFO, "AES-128 encrypt... " _YELLOW_("%s"), sprint_hex_inrow(dato, datilen)); } } } } - + return PM3_SUCCESS; } diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index ff556827d..3463ffc63 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -10398,9 +10398,9 @@ static int CmdHF14AMfInfo(const char *Cmd) { } else if (detect_classic_auth(MF_KEY_BD)) { PrintAndLogEx(SUCCESS, "Backdoor key..... " _RED_("detected but unknown!")); PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("hf mf nested --blk 0 -%s -k %s --tblk 0 --tc 4") "`" - , (fKeyType == MF_KEY_A) ? "a" : "b" - , sprint_hex_inrow(fkey, MIFARE_KEY_SIZE) - ); + , (fKeyType == MF_KEY_A) ? "a" : "b" + , sprint_hex_inrow(fkey, MIFARE_KEY_SIZE) + ); fKeyType = MF_KEY_BD; } } diff --git a/client/src/cmdmqtt.c b/client/src/cmdmqtt.c index 72b0914c7..1a0ea15ae 100644 --- a/client/src/cmdmqtt.c +++ b/client/src/cmdmqtt.c @@ -303,23 +303,23 @@ static int CmdMqttSend(const char *Cmd) { if (strlen(g_session.mqtt_server)) { strcpy(addr, g_session.mqtt_server); } else { - strcpy(addr, "proxdump.com"); - } + strcpy(addr, "proxdump.com"); + } } if (plen == 0) { if (strlen(g_session.mqtt_port)) { strcpy(port, g_session.mqtt_port); } else { - strcpy(port, "1883"); - } + strcpy(port, "1883"); + } } if (tlen == 0) { if (strlen(g_session.mqtt_topic)) { strcpy(topic, g_session.mqtt_topic); } else { - strcpy(topic, "proxdump"); + strcpy(topic, "proxdump"); } } @@ -380,23 +380,23 @@ static int CmdMqttReceive(const char *Cmd) { if (strlen(g_session.mqtt_server)) { strcpy(addr, g_session.mqtt_server); } else { - strcpy(addr, "proxdump.com"); - } + strcpy(addr, "proxdump.com"); + } } if (plen == 0) { if (strlen(g_session.mqtt_port)) { strcpy(port, g_session.mqtt_port); } else { - strcpy(port, "1883"); - } + strcpy(port, "1883"); + } } if (tlen == 0) { if (strlen(g_session.mqtt_topic)) { strcpy(topic, g_session.mqtt_topic); } else { - strcpy(topic, "proxdump"); + strcpy(topic, "proxdump"); } } diff --git a/client/src/mifare/mifaredefault.h b/client/src/mifare/mifaredefault.h index bcdc4a84b..e43c42a4b 100644 --- a/client/src/mifare/mifaredefault.h +++ b/client/src/mifare/mifaredefault.h @@ -121,20 +121,24 @@ static const uint64_t g_mifare_default_keys[] = { 0x96a301bce267, }; -static const uint8_t g_mifare_default_key[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; -static const uint8_t g_mifare_mad_key[] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5}; -static const uint8_t g_mifare_mad_key_b[] = {0x89, 0xEC, 0xA9, 0x7F, 0x8C, 0x2A}; +static const uint8_t g_mifare_default_key[MIFARE_KEY_SIZE] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +static const uint8_t g_mifare_mad_key[MIFARE_KEY_SIZE] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5}; +static const uint8_t g_mifare_mad_key_b[MIFARE_KEY_SIZE] = {0x89, 0xEC, 0xA9, 0x7F, 0x8C, 0x2A}; // 16 key B D01AFEEB890A -static const uint8_t g_mifare_signature_key_a[] = {0x5C, 0x8F, 0xF9, 0x99, 0x0D, 0xA2}; -static const uint8_t g_mifare_signature_key_b[] = {0x4b, 0x79, 0x1b, 0xea, 0x7b, 0xcc}; +static const uint8_t g_mifare_signature_key_a[MIFARE_KEY_SIZE] = {0x5C, 0x8F, 0xF9, 0x99, 0x0D, 0xA2}; +static const uint8_t g_mifare_signature_key_b[MIFARE_KEY_SIZE] = {0x4b, 0x79, 0x1b, 0xea, 0x7b, 0xcc}; // Manufacture MFC / QL88 (S17 / B) -static const uint8_t g_mifare_ql88_signature_key_b[] = {0x70, 0x7B, 0x11, 0xFC, 0x14, 0x81}; +static const uint8_t g_mifare_ql88_signature_key_b[MIFARE_KEY_SIZE] = {0x70, 0x7B, 0x11, 0xFC, 0x14, 0x81}; -static const uint8_t g_mifare_ndef_key[] = {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}; +static const uint8_t g_mifare_ndef_key[MIFARE_KEY_SIZE] = {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}; static const uint8_t g_mifarep_mad_key[] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7}; static const uint8_t g_mifarep_ndef_key[] = {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}; +static const uint8_t g_mifare_k08s[MIFARE_KEY_SIZE] = {0xA3, 0x96, 0xEF, 0xA4, 0xE2, 0x4F}; +static const uint8_t g_mifare_k08[MIFARE_KEY_SIZE] = {0xA3, 0x16, 0x67, 0xA8, 0xCE, 0xC1}; +static const uint8_t g_mifare_k32n[MIFARE_KEY_SIZE] = {0x51, 0x8B, 0x33, 0x54, 0xE7, 0x60}; +static const uint8_t g_mifare_k32n2[MIFARE_KEY_SIZE] = {0x73, 0xB9, 0x83, 0x6C, 0xF1, 0x68}; extern const char *g_mifare_plus_default_keys[]; extern size_t g_mifare_plus_default_keys_len; diff --git a/client/src/pm3line_vocabulary.h b/client/src/pm3line_vocabulary.h index 7cae2a36a..0d2672fad 100644 --- a/client/src/pm3line_vocabulary.h +++ b/client/src/pm3line_vocabulary.h @@ -51,6 +51,7 @@ const static vocabulary_t vocabulary[] = { { 1, "prefs get hints" }, { 1, "prefs get output" }, { 1, "prefs get plotsliders" }, + { 1, "prefs get mqtt" }, { 1, "prefs set help" }, { 1, "prefs set barmode" }, { 1, "prefs set client.debug" }, @@ -62,6 +63,7 @@ const static vocabulary_t vocabulary[] = { { 1, "prefs set savepaths" }, { 1, "prefs set output" }, { 1, "prefs set plotsliders" }, + { 1, "prefs set mqtt" }, { 1, "analyse help" }, { 1, "analyse lrc" }, { 1, "analyse crc" }, diff --git a/doc/commands.json b/doc/commands.json index 2c1c2b02a..feddfcfa9 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -278,9 +278,8 @@ }, "data crypto": { "command": "data crypto", - "description": "Encrypt data, right here, right now. Or decrypt.", + "description": "This command lets you encrypt or decrypt data using DES/3DES/AES. Supply data, key, IV (needed for des MAC or aes), and cryptography action.", "notes": [ - "Supply data, key, IV (needed for des MAC or aes), and cryptography action.", "To calculate a MAC for FMCOS, supply challenge as IV, data as data, and session/line protection key as key.", "To calculate a MAC for FeliCa, supply first RC as IV, BLE+data as data and session key as key.", "data crypto -d 04D6850E06AABB80 -k FFFFFFFFFFFFFFFF --iv 9EA0401A00000000 --des -> Calculate a MAC for FMCOS chip. The result should be ED3A0133" @@ -12797,6 +12796,18 @@ ], "usage": "prefs get hints [-h]" }, + "prefs get mqtt": { + "command": "prefs get mqtt", + "description": "Get preference of MQTT settings in the client", + "notes": [ + "prefs get mqtt" + ], + "offline": true, + "options": [ + "-h, --help This help" + ], + "usage": "prefs get mqtt [-h]" + }, "prefs get output": { "command": "prefs get output", "description": "Get preference of dump output style", @@ -12922,7 +12933,7 @@ }, "prefs set help": { "command": "prefs set help", - "description": "help This help barmode Set bar mode client.debug Set client debug level client.delay Set client execution delay client.timeout Set client communication timeout color Set color support emoji Set emoji display hints Set hint display savepaths ... to be adjusted next ... output Set dump output style plotsliders Set plot slider display --------------------------------------------------------------------------------------- prefs set barmode available offline: yes Set persistent preference of HF/LF tune command styled output in the client", + "description": "help This help barmode Set bar mode client.debug Set client debug level client.delay Set client execution delay client.timeout Set client communication timeout color Set color support emoji Set emoji display hints Set hint display savepaths ... to be adjusted next ... output Set dump output style plotsliders Set plot slider display mqtt Set MQTT default values --------------------------------------------------------------------------------------- prefs set barmode available offline: yes Set persistent preference of HF/LF tune command styled output in the client", "notes": [ "prefs set barmode --mix" ], @@ -12949,6 +12960,22 @@ ], "usage": "prefs set hints [-h] [--off] [--on]" }, + "prefs set mqtt": { + "command": "prefs set mqtt", + "description": "Set persistent preference MQTT Server in the client", + "notes": [ + "prefs set mqtt -s test.mosquito.com", + "prefs set mqtt -s test.mosquito.com -p 1883 -t proxdump" + ], + "offline": true, + "options": [ + "-h, --help This help", + "-s, --srv default MQTT Server", + "-p, --port default MQTT Port", + "-t, --topic default MQTT Topic" + ], + "usage": "prefs set mqtt [-h] [-s ] [-p ] [-t ]" + }, "prefs set output": { "command": "prefs set output", "description": "Set dump output style to condense consecutive repeated data", @@ -13411,8 +13438,8 @@ } }, "metadata": { - "commands_extracted": 770, + "commands_extracted": 772, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2025-07-10T05:07:28" + "extracted_on": "2025-07-13T13:53:32" } } diff --git a/doc/commands.md b/doc/commands.md index 96bb744d9..05cec3ad5 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -46,6 +46,7 @@ Check column "offline" for their availability. |`prefs get hints `|Y |`Get hint display preference` |`prefs get output `|Y |`Get dump output style preference` |`prefs get plotsliders `|Y |`Get plot slider display preference` +|`prefs get mqtt `|Y |`Get MQTT preference` ### prefs set @@ -65,6 +66,7 @@ Check column "offline" for their availability. |`prefs set savepaths `|Y |`... to be adjusted next ... ` |`prefs set output `|Y |`Set dump output style` |`prefs set plotsliders `|Y |`Set plot slider display` +|`prefs set mqtt `|Y |`Set MQTT default values` ### analyse