case 121: return ((char *) HT_00121); break;
case 122: return ((char *) HT_00122); break;
case 124: return ((char *) HT_00124); break;
+ case 125: return ((char *) HT_00125); break;
case 130: return ((char *) HT_00130); break;
case 131: return ((char *) HT_00131); break;
case 132: return ((char *) HT_00132); break;
snprintf (out_buf, len-1, "{SSHA}%s", ptr_plain);
}
- else if (hash_mode == 122)
+ else if ((hash_mode == 122) || (hash_mode == 125))
{
snprintf (out_buf, len-1, "%s%08x%08x%08x%08x%08x",
(char *) salt.salt_buf,
wpa_t *wpa = &wpas[salt_pos];
- uint pke[25] = { 0 };
-
- char *pke_ptr = (char *) pke;
-
- for (uint i = 0; i < 25; i++)
- {
- pke[i] = byte_swap_32 (wpa->pke[i]);
- }
-
- unsigned char mac1[6] = { 0 };
- unsigned char mac2[6] = { 0 };
-
- memcpy (mac1, pke_ptr + 23, 6);
- memcpy (mac2, pke_ptr + 29, 6);
-
snprintf (out_buf, len-1, "%s:%02x%02x%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x",
(char *) salt.salt_buf,
- mac1[0],
- mac1[1],
- mac1[2],
- mac1[3],
- mac1[4],
- mac1[5],
- mac2[0],
- mac2[1],
- mac2[2],
- mac2[3],
- mac2[4],
- mac2[5]);
+ wpa->orig_mac1[0],
+ wpa->orig_mac1[1],
+ wpa->orig_mac1[2],
+ wpa->orig_mac1[3],
+ wpa->orig_mac1[4],
+ wpa->orig_mac1[5],
+ wpa->orig_mac2[0],
+ wpa->orig_mac2[1],
+ wpa->orig_mac2[2],
+ wpa->orig_mac2[3],
+ wpa->orig_mac2[4],
+ wpa->orig_mac2[5]);
}
else if (hash_mode == 4400)
{
{
char digest_buf_c[34] = { 0 };
+ digest_buf[0] = byte_swap_32 (digest_buf[0]);
+ digest_buf[1] = byte_swap_32 (digest_buf[1]);
+ digest_buf[2] = byte_swap_32 (digest_buf[2]);
+ digest_buf[3] = byte_swap_32 (digest_buf[3]);
+ digest_buf[4] = byte_swap_32 (digest_buf[4]);
+
base32_encode (int_to_itoa32, (const u8 *) digest_buf, 20, (u8 *) digest_buf_c);
digest_buf_c[32] = 0;
memcpy (hccap->eapol, wpa->eapol, wpa->eapol_size);
}
- uint pke_tmp[25] = { 0 };
-
- for (int i = 5; i < 25; i++)
- {
- pke_tmp[i] = byte_swap_32 (wpa->pke[i]);
- }
-
- char *pke_ptr = (char *) pke_tmp;
-
- memcpy (hccap->mac1, pke_ptr + 23, 6);
- memcpy (hccap->mac2, pke_ptr + 29, 6);
- memcpy (hccap->nonce1, pke_ptr + 67, 32);
- memcpy (hccap->nonce2, pke_ptr + 35, 32);
+ memcpy (hccap->mac1, wpa->orig_mac1, 6);
+ memcpy (hccap->mac2, wpa->orig_mac2, 6);
+ memcpy (hccap->nonce1, wpa->orig_nonce1, 32);
+ memcpy (hccap->nonce2, wpa->orig_nonce2, 32);
char *digests_buf_ptr = (char *) data.digests_buf;
{
if (data.devices_status == STATUS_PAUSED)
{
- float ms_paused;
+ double ms_paused;
hc_timer_get (data.timer_paused, ms_paused);
fclose (fp);
- char new_cwd[1024] = { 0 };
-
- char *nwd = getcwd (new_cwd, sizeof (new_cwd));
-
- if (nwd == NULL)
- {
- log_error ("Restore file is corrupted");
- }
-
- if (strncmp (new_cwd, rd->cwd, sizeof (new_cwd)) != 0)
- {
- if (getcwd (rd->cwd, sizeof (rd->cwd)) == NULL)
- {
- log_error ("ERROR: could not determine current user path: %s", strerror (errno));
-
- exit (-1);
- }
-
- log_info ("WARNING: Found old restore file, updating path to %s...", new_cwd);
- }
+ log_info ("INFO: Changing current working directory to the path found within the .restore file: '%s'", rd->cwd);
if (chdir (rd->cwd))
{
- log_error ("ERROR: cannot chdir to %s: %s", rd->cwd, strerror (errno));
+ log_error ("ERROR: The directory '%s' does not exist. It is needed to restore (--restore) the session.\n"
+ " You could either create this directory (or link it) or update the .restore file using e.g. the analyze_hc_restore.pl tool:\n"
+ " https://github.com/philsmd/analyze_hc_restore\n"
+ " The directory must be relative to (or contain) all files/folders mentioned within the command line.", rd->cwd);
exit (-1);
}
return (PARSER_OK);
}
+int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
+{
+ if ((input_len < DISPLAY_LEN_MIN_125) || (input_len > DISPLAY_LEN_MAX_125)) return (PARSER_GLOBAL_LENGTH);
+
+ if ((input_buf[8] != '0') || (input_buf[9] != '1')) return (PARSER_SIGNATURE_UNMATCHED);
+
+ u32 *digest = (u32 *) hash_buf->digest;
+
+ salt_t *salt = hash_buf->salt;
+
+ char *hash_pos = input_buf + 10;
+
+ digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]);
+ digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]);
+ digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]);
+ digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]);
+ digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]);
+
+ digest[0] -= SHA1M_A;
+ digest[1] -= SHA1M_B;
+ digest[2] -= SHA1M_C;
+ digest[3] -= SHA1M_D;
+ digest[4] -= SHA1M_E;
+
+ uint salt_len = 10;
+
+ char *salt_buf_ptr = (char *) salt->salt_buf;
+
+ salt_len = parse_and_store_salt (salt_buf_ptr, input_buf, salt_len);
+
+ if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH);
+
+ salt->salt_len = salt_len;
+
+ return (PARSER_OK);
+}
+
int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
{
if ((input_len < DISPLAY_LEN_MIN_122) || (input_len > DISPLAY_LEN_MAX_122)) return (PARSER_GLOBAL_LENGTH);
wpa->pke[i] = byte_swap_32 (wpa->pke[i]);
}
+ memcpy (wpa->orig_mac1, in.mac1, 6);
+ memcpy (wpa->orig_mac2, in.mac2, 6);
+ memcpy (wpa->orig_nonce1, in.nonce1, 32);
+ memcpy (wpa->orig_nonce2, in.nonce2, 32);
+
wpa->keyver = in.keyver;
if (wpa->keyver > 255)
if (ch == 0) continue;
- #ifdef _POSIX
- if (ch != '\n')
- #endif
+ //https://github.com/hashcat/oclHashcat/issues/302
+ //#ifdef _POSIX
+ //if (ch != '\n')
+ //#endif
hc_thread_mutex_lock (mux_display);
switch (ch)
{
case 's':
+ case '\r':
case '\n':
log_info ("");
break;
}
+ //https://github.com/hashcat/oclHashcat/issues/302
+ //#ifdef _POSIX
+ //if (ch != '\n')
+ //#endif
+
hc_thread_mutex_unlock (mux_display);
}