From 2f2443c7fa3c493453dd5f86d5b70a4bd3368ec5 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 24 Feb 2020 21:31:58 +0100 Subject: [PATCH 1/3] text --- client/proxmark3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/proxmark3.c b/client/proxmark3.c index d582bafc0..522d982c7 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -61,7 +61,7 @@ static int check_comm(void) { rl_set_prompt(PROXPROMPT_OFFLINE); rl_forced_update_display(); CloseProxmark(); - PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Use \"hw connect\" to reconnect\n"); + PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Use "_YELLOW_("\"hw connect\"") "to reconnect\n"); } return 0; } From 52452c8ddeb0afe94a43e3ef325436833553710b Mon Sep 17 00:00:00 2001 From: Iceman Date: Tue, 25 Feb 2020 15:37:27 +0100 Subject: [PATCH 2/3] Update Linux-Installation-Instructions.md --- .../Linux-Installation-Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/md/Installation_Instructions/Linux-Installation-Instructions.md b/doc/md/Installation_Instructions/Linux-Installation-Instructions.md index 30d4fbf54..b381eb7d9 100644 --- a/doc/md/Installation_Instructions/Linux-Installation-Instructions.md +++ b/doc/md/Installation_Instructions/Linux-Installation-Instructions.md @@ -51,7 +51,7 @@ If you don't need the graphical components of the Proxmark3 client (such as in ` ## On openSUSE ```sh -sudo zypper install git patterns-devel-base-devel_basis gcc-c++ readline-devel cross-arm-none-gcc9 cross-arm-none-newlib-devel +sudo zypper install git patterns-devel-base-devel_basis gcc-c++ readline-devel cross-arm-none-gcc9 cross-arm-none-newlib-devel libqt5-qtbase-devel ``` If you don't need the graphical components of the Proxmark3 client (such as in `hw tune`), you can skip the installation of `libqt5-qtbase-devel`. From ab7bf0cb2ad9d8579959f25d05025eeddfd563bd Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 27 Feb 2020 14:26:28 +0100 Subject: [PATCH 3/3] fix: hf mf autopwn on debian... --- client/cmdhfmfhard.c | 53 +++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c index 90f686b80..beb85df5b 100644 --- a/client/cmdhfmfhard.c +++ b/client/cmdhfmfhard.c @@ -1390,7 +1390,6 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ char progress_text[80]; FILE *fnonces = NULL; PacketResponseNG resp; - num_acquired_nonces = 0; clearCommandBuffer(); @@ -1402,24 +1401,35 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ flags |= field_off ? 0x0004 : 0; clearCommandBuffer(); - SendCommandMIX(CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, key, 6); - if (field_off) break; + if (field_off) { + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); + break; + } else { + SendCommandMIX(CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, key, 6); + } if (initialize) { + if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) { - uint8_t nullkey[6] = {0}; - //strange second call (iceman) clearCommandBuffer(); - SendCommandMIX(CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, nullkey, sizeof(nullkey)); + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); return 1; } - if (resp.oldarg[0]) return resp.oldarg[0]; // error during nested_hard + + // error during nested_hard + if (resp.oldarg[0]) { + clearCommandBuffer(); + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); + return resp.oldarg[0]; + } cuid = resp.oldarg[1]; if (nonce_file_write && fnonces == NULL) { if ((fnonces = fopen(filename, "wb")) == NULL) { PrintAndLogEx(WARNING, "Could not create file %s", filename); + clearCommandBuffer(); + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); return 3; } snprintf(progress_text, 80, "Writing acquired nonces to binary file %s", filename); @@ -1486,17 +1496,24 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ } if (!initialize) { + if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) { if (nonce_file_write) { fclose(fnonces); } + clearCommandBuffer(); + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); return 1; } + + // error during nested_hard if (resp.oldarg[0]) { if (nonce_file_write) { fclose(fnonces); } - return resp.oldarg[0]; // error during nested_hard + clearCommandBuffer(); + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); + return resp.oldarg[0]; } } @@ -1513,11 +1530,6 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ fclose(fnonces); } - // PrintAndLogEx(NORMAL, "Sampled a total of %d nonces in %d seconds (%0.0f nonces/minute)", - // total_num_nonces, - // time(NULL)-time1, - // (float)total_num_nonces*60.0/(time(NULL)-time1)); - return 0; } @@ -1681,11 +1693,12 @@ static bool all_bitflips_match(uint8_t byte, uint32_t state, odd_even_t odd_even for (uint8_t remaining_bits = 0; remaining_bits <= (~mask & 0xff); remaining_bits++) { if (remaining_bits_match(num_common, bytes_diff, state, (state & mask) | remaining_bits, odd_even)) { -#ifdef DEBUG_KEY_ELIMINATION - if (bitflips_match(byte2, (state & mask) | remaining_bits, odd_even, true)) { -#else - if (bitflips_match(byte2, (state & mask) | remaining_bits, odd_even)) { -#endif +# ifdef DEBUG_KEY_ELIMINATION + if (bitflips_match(byte2, (state & mask) | remaining_bits, odd_even, true)) +# else + if (bitflips_match(byte2, (state & mask) | remaining_bits, odd_even)) +# endif + { found_match = true; break; } @@ -1694,7 +1707,7 @@ static bool all_bitflips_match(uint8_t byte, uint32_t state, odd_even_t odd_even if (!found_match) { -#ifdef DEBUG_KEY_ELIMINATION +# ifdef DEBUG_KEY_ELIMINATION if (known_target_key != -1 && state == test_state[odd_even]) { PrintAndLogEx(NORMAL, "all_bitflips_match() 1st Byte: %s test state (0x%06x): Eliminated. Bytes = %02x, %02x, Common Bits = %d\n", odd_even == ODD_STATE ? "odd" : "even", @@ -1706,7 +1719,7 @@ static bool all_bitflips_match(uint8_t byte, uint32_t state, odd_even_t odd_even sprintf(failstr, "Other 1st Byte %s, all_bitflips_match(), no match", odd_even ? "odd" : "even"); } } -#endif +# endif return false; } }