1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 08:38:09 +00:00

Fix use of OPTS_TYPE_COPY_TMPS in modules

This commit is contained in:
jsteube 2019-03-30 16:55:55 +01:00
parent d80603648e
commit 2158fd70c9
5 changed files with 84 additions and 7 deletions

View File

@ -268,7 +268,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
if (hashconfig->opts_type & OPTS_TYPE_COPY_TMPS) if (hashconfig->opts_type & OPTS_TYPE_COPY_TMPS)
{ {
void *tmps = hcmalloc (hashconfig->tmp_size); tmps = hcmalloc (hashconfig->tmp_size);
hc_clEnqueueReadBuffer (hashcat_ctx, device_param->command_queue, device_param->d_tmps, CL_TRUE, plain->gidvid * hashconfig->tmp_size, hashconfig->tmp_size, tmps, 0, NULL, NULL); hc_clEnqueueReadBuffer (hashcat_ctx, device_param->command_queue, device_param->d_tmps, CL_TRUE, plain->gidvid * hashconfig->tmp_size, hashconfig->tmp_size, tmps, 0, NULL, NULL);
} }

View File

@ -27,8 +27,9 @@ static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_AUX1 | OPTS_TYPE_AUX1
| OPTS_TYPE_AUX2 | OPTS_TYPE_AUX2
| OPTS_TYPE_AUX3 | OPTS_TYPE_AUX3
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_DEEP_COMP_KERNEL | OPTS_TYPE_DEEP_COMP_KERNEL
| OPTS_TYPE_BINARY_HASHFILE; | OPTS_TYPE_COPY_TMPS;
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
static const char *ST_PASS = "hashcat!"; static const char *ST_PASS = "hashcat!";
static const char *ST_HASH = "4843505804000000000235380000000000000000000000000000000000000000000000000000000000000151aecc428f182acefbd1a9e62d369a079265784da83ba4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b823a1cd402aed449cced04f552c5b5acfebf06ae96a09c96d9a01c443a17aa62258c4f651a68aa67b0001030077fe010900200000000000000001a4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b8230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018dd160050f20101000050f20201000050f20201000050f20200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; static const char *ST_HASH = "4843505804000000000235380000000000000000000000000000000000000000000000000000000000000151aecc428f182acefbd1a9e62d369a079265784da83ba4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b823a1cd402aed449cced04f552c5b5acfebf06ae96a09c96d9a01c443a17aa62258c4f651a68aa67b0001030077fe010900200000000000000001a4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b8230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018dd160050f20101000050f20201000050f20201000050f20200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";

View File

@ -27,8 +27,9 @@ static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_AUX1 | OPTS_TYPE_AUX1
| OPTS_TYPE_AUX2 | OPTS_TYPE_AUX2
| OPTS_TYPE_AUX3 | OPTS_TYPE_AUX3
| OPTS_TYPE_BINARY_HASHFILE
| OPTS_TYPE_DEEP_COMP_KERNEL | OPTS_TYPE_DEEP_COMP_KERNEL
| OPTS_TYPE_BINARY_HASHFILE; | OPTS_TYPE_COPY_TMPS;
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
static const char *ST_PASS = "7f620a599c445155935a35634638fa67b4aafecb92e0bd8625388757a63c2dda"; static const char *ST_PASS = "7f620a599c445155935a35634638fa67b4aafecb92e0bd8625388757a63c2dda";
static const char *ST_HASH = "4843505804000000000235380000000000000000000000000000000000000000000000000000000000000151aecc428f182acefbd1a9e62d369a079265784da83ba4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b823a1cd402aed449cced04f552c5b5acfebf06ae96a09c96d9a01c443a17aa62258c4f651a68aa67b0001030077fe010900200000000000000001a4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b8230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018dd160050f20101000050f20201000050f20201000050f20200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; static const char *ST_HASH = "4843505804000000000235380000000000000000000000000000000000000000000000000000000000000151aecc428f182acefbd1a9e62d369a079265784da83ba4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b823a1cd402aed449cced04f552c5b5acfebf06ae96a09c96d9a01c443a17aa62258c4f651a68aa67b0001030077fe010900200000000000000001a4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b8230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018dd160050f20101000050f20201000050f20201000050f20200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";

View File

@ -235,9 +235,34 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{ {
const wpa_pmkid_t *wpa_pmkid = (const wpa_pmkid_t *) esalt_buf; const wpa_pmkid_t *wpa_pmkid = (const wpa_pmkid_t *) esalt_buf;
exec_hexify ((const u8 *) wpa_pmkid->essid_buf, (const size_t) wpa_pmkid->essid_len, (u8 *) line_buf); char tmp_buf[128];
return wpa_pmkid->essid_len * 2; exec_hexify ((const u8*) wpa_pmkid->essid_buf, wpa_pmkid->essid_len, (u8 *) tmp_buf);
const int tmp_len = wpa_pmkid->essid_len * 2;
tmp_buf[tmp_len] = 0;
const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x*%02x%02x%02x%02x%02x%02x*%02x%02x%02x%02x%02x%02x*%s",
byte_swap_32 (wpa_pmkid->pmkid[0]),
byte_swap_32 (wpa_pmkid->pmkid[1]),
byte_swap_32 (wpa_pmkid->pmkid[2]),
byte_swap_32 (wpa_pmkid->pmkid[3]),
wpa_pmkid->orig_mac_ap[0],
wpa_pmkid->orig_mac_ap[1],
wpa_pmkid->orig_mac_ap[2],
wpa_pmkid->orig_mac_ap[3],
wpa_pmkid->orig_mac_ap[4],
wpa_pmkid->orig_mac_ap[5],
wpa_pmkid->orig_mac_sta[0],
wpa_pmkid->orig_mac_sta[1],
wpa_pmkid->orig_mac_sta[2],
wpa_pmkid->orig_mac_sta[3],
wpa_pmkid->orig_mac_sta[4],
wpa_pmkid->orig_mac_sta[5],
tmp_buf);
return line_len;
} }
void module_init (module_ctx_t *module_ctx) void module_init (module_ctx_t *module_ctx)

View File

@ -266,9 +266,59 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{ {
const wpa_pmkid_t *wpa_pmkid = (const wpa_pmkid_t *) esalt_buf; const wpa_pmkid_t *wpa_pmkid = (const wpa_pmkid_t *) esalt_buf;
exec_hexify ((const u8 *) wpa_pmkid->essid_buf, (const size_t) wpa_pmkid->essid_len, (u8 *) line_buf); int line_len = 0;
return wpa_pmkid->essid_len * 2; if (wpa_pmkid->essid_len)
{
char tmp_buf[128];
exec_hexify ((const u8*) wpa_pmkid->essid_buf, wpa_pmkid->essid_len, (u8 *) tmp_buf);
int tmp_len = wpa_pmkid->essid_len * 2;
tmp_buf[tmp_len] = 0;
line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x*%02x%02x%02x%02x%02x%02x*%02x%02x%02x%02x%02x%02x*%s",
byte_swap_32 (wpa_pmkid->pmkid[0]),
byte_swap_32 (wpa_pmkid->pmkid[1]),
byte_swap_32 (wpa_pmkid->pmkid[2]),
byte_swap_32 (wpa_pmkid->pmkid[3]),
wpa_pmkid->orig_mac_ap[0],
wpa_pmkid->orig_mac_ap[1],
wpa_pmkid->orig_mac_ap[2],
wpa_pmkid->orig_mac_ap[3],
wpa_pmkid->orig_mac_ap[4],
wpa_pmkid->orig_mac_ap[5],
wpa_pmkid->orig_mac_sta[0],
wpa_pmkid->orig_mac_sta[1],
wpa_pmkid->orig_mac_sta[2],
wpa_pmkid->orig_mac_sta[3],
wpa_pmkid->orig_mac_sta[4],
wpa_pmkid->orig_mac_sta[5],
tmp_buf);
}
else
{
line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x*%02x%02x%02x%02x%02x%02x*%02x%02x%02x%02x%02x%02x",
byte_swap_32 (wpa_pmkid->pmkid[0]),
byte_swap_32 (wpa_pmkid->pmkid[1]),
byte_swap_32 (wpa_pmkid->pmkid[2]),
byte_swap_32 (wpa_pmkid->pmkid[3]),
wpa_pmkid->orig_mac_ap[0],
wpa_pmkid->orig_mac_ap[1],
wpa_pmkid->orig_mac_ap[2],
wpa_pmkid->orig_mac_ap[3],
wpa_pmkid->orig_mac_ap[4],
wpa_pmkid->orig_mac_ap[5],
wpa_pmkid->orig_mac_sta[0],
wpa_pmkid->orig_mac_sta[1],
wpa_pmkid->orig_mac_sta[2],
wpa_pmkid->orig_mac_sta[3],
wpa_pmkid->orig_mac_sta[4],
wpa_pmkid->orig_mac_sta[5]);
}
return line_len;
} }
void module_init (module_ctx_t *module_ctx) void module_init (module_ctx_t *module_ctx)