WPA/WPA2 cracking: In the potfile, replace password with PMK in order to detect already cracked networks across all WPA modes

This commit is contained in:
jsteube
2019-04-02 11:24:22 +02:00
parent c0a31b3239
commit b8d609ba16
293 changed files with 1149 additions and 349 deletions

View File

@@ -66,4 +66,7 @@ u32 v32a_from_v64 (const u64 v64);
u32 v32b_from_v64 (const u64 v64);
u64 v64_from_v32ab (const u32 v32a, const u32 v32b);
int hex_decode (const u8 *in_buf, const int in_len, u8 *out_buf);
int hex_encode (const u8 *in_buf, const int in_len, u8 *out_buf);
#endif // _CONVERT_H

View File

@@ -1,57 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_M02501_PURE_H
#define _EMU_M02501_PURE_H
#define DGST_ELEM 4
#define DGST_POS0 0
#define DGST_POS1 1
#define DGST_POS2 2
#define DGST_POS3 3
typedef struct digest
{
u32 digest_buf[DGST_ELEM];
} digest_t;
typedef struct wpa_pmk_tmp
{
u32 out[8];
} wpa_pmk_tmp_t;
typedef struct wpa_eapol
{
u32 pke[32];
u32 eapol[64 + 16];
u16 eapol_len;
u8 message_pair;
int message_pair_chgd;
u8 keyver;
u8 orig_mac_ap[6];
u8 orig_mac_sta[6];
u8 orig_nonce_ap[32];
u8 orig_nonce_sta[32];
u8 essid_len;
u8 essid[32];
u32 keymic[4];
u32 hash[4];
int nonce_compare;
int nonce_error_corrections;
int detected_le;
int detected_be;
} wpa_eapol_t;
KERNEL_FQ void m02501_init (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t));
KERNEL_FQ void m02501_loop (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t));
KERNEL_FQ void m02501_comp (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t));
KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t));
KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t));
KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t));
#endif // _EMU_M02501_PURE_H

View File

@@ -1,45 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_M16801_PURE_H
#define _EMU_M16801_PURE_H
#define DGST_ELEM 4
#define DGST_POS0 0
#define DGST_POS1 1
#define DGST_POS2 2
#define DGST_POS3 3
typedef struct digest
{
u32 digest_buf[DGST_ELEM];
} digest_t;
typedef struct wpa_pmk_tmp
{
u32 out[8];
} wpa_pmk_tmp_t;
typedef struct wpa_pmkid
{
u32 pmkid[4];
u32 pmkid_data[16];
u8 orig_mac_ap[6];
u8 orig_mac_sta[6];
u8 essid_len;
u32 essid_buf[16];
} wpa_pmkid_t;
KERNEL_FQ void m16801_init (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t));
KERNEL_FQ void m16801_loop (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t));
KERNEL_FQ void m16801_comp (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t));
KERNEL_FQ void m16801_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t));
KERNEL_FQ void m16801_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t));
KERNEL_FQ void m16801_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t));
#endif // _EMU_M16801_PURE_H

View File

@@ -54,7 +54,7 @@ int module_hash_binary_count (MAYBE_UNUSED const hashes_t *hashes
int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, hashes_t *hashes);
int module_hash_binary_save (MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const u32 salt_pos, MAYBE_UNUSED const u32 digest_pos, char **buf);
int module_hash_decode_potfile (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len);
int module_hash_decode_potfile (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len, MAYBE_UNUSED void *tmps);
int module_hash_decode_zero_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info);
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len);
int module_hash_encode_potfile (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size, MAYBE_UNUSED const void *tmps);
@@ -76,4 +76,6 @@ int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *ha
bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hc_device_param_t *device_param);
bool module_potfile_custom_check (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const hash_t *db, MAYBE_UNUSED const hash_t *entry_hash, MAYBE_UNUSED const void *entry_tmps);
#endif // _MODULES_H

View File

@@ -415,6 +415,7 @@ typedef enum opts_type
OPTS_TYPE_DEEP_COMP_KERNEL = (1ULL << 42), // if we have to iterate through each hash inside the comp kernel, for example if each hash has to be decrypted separately
OPTS_TYPE_SUGGEST_KG = (1ULL << 43), // suggest keep guessing for modules the user maybe wants to use --keep-guessing
OPTS_TYPE_COPY_TMPS = (1ULL << 44), // if we want to use data from tmps buffer (for example get the PMK in WPA)
OPTS_TYPE_POTFILE_NOPASS = (1ULL << 45), // sometimes the password should not be printed to potfile
} opts_type_t;
@@ -2244,7 +2245,7 @@ typedef struct module_ctx
int (*module_hash_binary_parse) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, hashes_t *);
int (*module_hash_binary_save) (const hashes_t *, const u32, const u32, char **);
int (*module_hash_decode_potfile) (const hashconfig_t *, void *, salt_t *, void *, void *, hashinfo_t *, const char *, const int);
int (*module_hash_decode_potfile) (const hashconfig_t *, void *, salt_t *, void *, void *, hashinfo_t *, const char *, const int, void *);
int (*module_hash_decode_zero_hash) (const hashconfig_t *, void *, salt_t *, void *, void *, hashinfo_t *);
int (*module_hash_decode) (const hashconfig_t *, void *, salt_t *, void *, void *, hashinfo_t *, const char *, const int);
int (*module_hash_encode_potfile) (const hashconfig_t *, const void *, const salt_t *, const void *, const void *, const hashinfo_t *, char *, int, const void *);
@@ -2266,6 +2267,8 @@ typedef struct module_ctx
bool (*module_unstable_warning) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const hc_device_param_t *);
bool (*module_potfile_custom_check) (const hashconfig_t *, const hash_t *, const hash_t *, const void *);
} module_ctx_t;
typedef struct hashcat_ctx