Merge branch 'master' into mad-security-rewrite
Signed-off-by: Alexandre CHAZAL <AlxCzl@users.noreply.github.com>
This commit is contained in:
4 files changed
+95
-96
No files matched your search
@@ -279,12 +279,12 @@ def recovery(init_check=False, final_check=False, keep=False, no_oob=False,
|
||||
nt[sec][key_type], nt_enc[sec][key_type], par_err[sec][key_type]]
|
||||
if debug:
|
||||
print(' '.join(cmd))
|
||||
subprocess.run(cmd, capture_output=True)
|
||||
subprocess.run(cmd, capture_output=True, shell=False)
|
||||
cmd = [staticnested_2x1nt_path,
|
||||
f"keys_{uid:08x}_{real_sec:02}_{nt[sec][0]}.dic", f"keys_{uid:08x}_{real_sec:02}_{nt[sec][1]}.dic"]
|
||||
if debug:
|
||||
print(' '.join(cmd))
|
||||
subprocess.run(cmd, capture_output=True)
|
||||
subprocess.run(cmd, capture_output=True, shell=False)
|
||||
filtered_dicts[sec][key_type] = True
|
||||
for key_type in [0, 1]:
|
||||
keys_set = set()
|
||||
@@ -300,7 +300,7 @@ def recovery(init_check=False, final_check=False, keep=False, no_oob=False,
|
||||
f"keys_{uid:08x}_{real_sec:02}_{nt[sec][key_type]}_filtered.dic"]
|
||||
if debug:
|
||||
print(' '.join(cmd))
|
||||
result = subprocess.run(cmd, capture_output=True, text=True).stdout
|
||||
result = subprocess.run(cmd, capture_output=True, text=True, shell=False).stdout
|
||||
keys_def_set = set()
|
||||
for line in result.split('\n'):
|
||||
matched = match_key(line)
|
||||
@@ -332,7 +332,7 @@ def recovery(init_check=False, final_check=False, keep=False, no_oob=False,
|
||||
nt[sec][key_type], nt_enc[sec][key_type], par_err[sec][key_type]]
|
||||
if debug:
|
||||
print(' '.join(cmd))
|
||||
subprocess.run(cmd, capture_output=True)
|
||||
subprocess.run(cmd, capture_output=True, shell=False)
|
||||
keys_set = set()
|
||||
with (open(f"keys_{uid:08x}_{real_sec:02}_{nt[sec][key_type]}.dic")) as f:
|
||||
while line := f.readline().rstrip():
|
||||
|
||||
@@ -75,10 +75,11 @@ static unsigned char *emv_pki_decode_message(const struct emv_pk *enc_pk,
|
||||
data = crypto_pk_encrypt(kcp, cert_tlv->value, cert_tlv->len, &data_len);
|
||||
crypto_pk_close(kcp);
|
||||
|
||||
/* if (true){
|
||||
PrintAndLogEx(SUCCESS, "Recovered data:\n");
|
||||
print_buffer(data, data_len, 1);
|
||||
}*/
|
||||
if (data == NULL || data_len < 3) {
|
||||
PrintAndLogEx(WARNING, "ERROR: Certificate decrypt failed");
|
||||
free(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (data[data_len - 1] != 0xbc || data[0] != 0x6a || data[1] != msgtype) {
|
||||
PrintAndLogEx(WARNING, "ERROR: Certificate format");
|
||||
|
||||
@@ -3036,9 +3036,7 @@ static int filelist(const char *path, const char *ext, uint8_t last, bool tentat
|
||||
for (int i = 0; i < n; i++) {
|
||||
|
||||
char tmp_fullpath[1024] = {0};
|
||||
strncat(tmp_fullpath, path, sizeof(tmp_fullpath) - 1);
|
||||
tmp_fullpath[1023] = 0x00;
|
||||
strncat(tmp_fullpath, namelist[i]->d_name, strlen(tmp_fullpath) - 1);
|
||||
snprintf(tmp_fullpath, sizeof(tmp_fullpath), "%s%s", path, namelist[i]->d_name);
|
||||
|
||||
if (path_is_directory(tmp_fullpath)) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user