1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Merge branch 'master' into fix_18600_metal

This commit is contained in:
Gabriele Gristina 2023-04-16 15:31:23 +02:00 committed by GitHub
commit 3a8da27366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 510 additions and 252 deletions

View File

@ -37,6 +37,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
KERNEL_FQ void FIXED_THREAD_COUNT(FIXED_LOCAL_SIZE) m10400_m04 (KERN_ATTR_RULES_ESALT (pdf_t))

View File

@ -35,6 +35,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
KERNEL_FQ void FIXED_THREAD_COUNT(FIXED_LOCAL_SIZE) m10400_m04 (KERN_ATTR_ESALT (pdf_t))

View File

@ -35,6 +35,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
DECLSPEC void m10400m (LOCAL_AS u32 *S, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 pw_len, KERN_ATTR_FUNC_ESALT (pdf_t))

View File

@ -37,6 +37,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
KERNEL_FQ void FIXED_THREAD_COUNT(FIXED_LOCAL_SIZE) m10410_m04 (KERN_ATTR_RULES_ESALT (pdf_t))

View File

@ -35,6 +35,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
KERNEL_FQ void FIXED_THREAD_COUNT(FIXED_LOCAL_SIZE) m10410_m04 (KERN_ATTR_ESALT (pdf_t))

View File

@ -35,6 +35,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
DECLSPEC void m10410m (LOCAL_AS u32 *S, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 pw_len, KERN_ATTR_FUNC_ESALT (pdf_t))

View File

@ -47,6 +47,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
KERNEL_FQ void m10420_m04 (KERN_ATTR_RULES_ESALT (pdf_t))

View File

@ -45,6 +45,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
KERNEL_FQ void m10420_m04 (KERN_ATTR_ESALT (pdf_t))

View File

@ -45,6 +45,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
DECLSPEC void m10420m (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 pw_len, KERN_ATTR_FUNC_ESALT (pdf_t))

View File

@ -34,6 +34,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
typedef struct pdf14_tmp

View File

@ -36,6 +36,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
typedef struct pdf17l8_tmp

View File

@ -42,6 +42,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
typedef struct pdf17l8_tmp

View File

@ -38,6 +38,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
typedef struct pdf14_tmp

View File

@ -29,6 +29,12 @@
- Added hash-mode: md5(md5($salt).md5(md5($pass)))
- Added hash-mode: md5(md5(md5($pass).$salt1).$salt2)
##
## Features
##
- Added new feature (-Y) that creates N virtual instances for each device in your system at the cost of N times the device memory consumption
##
## Performance
##
@ -46,6 +52,7 @@
- Fixed incorrect plaintext check for 25400 and 26610. Increased plaintext check to 32 bytes to prevent false positives.
- Fixed bug in --stdout that caused certain rules to malfunction
- Fixed build failed for 18600 with Apple Metal
- Handle signed/unsigned PDF permission P value for all PDF hash-modes
##
## Technical

View File

@ -425,9 +425,9 @@ _hashcat ()
local HIDDEN_FILES_AGGRESSIVE="${HIDDEN_FILES}|hcmask|hcchr"
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H'
local SHORT_OPTS="-m -a -V -h -b -t -T -o -p -c -d -D -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O -S -z -M"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-json --status-timer --stdin-timeout-abort --machine-readable --loopback --markov-hcstat2 --markov-disable --markov-inverse --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --deprecated-check-disable --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --hash-info --backend-ignore-cuda --backend-ignore-opencl --backend-ignore-hip --backend-ignore-metal --backend-info --backend-devices --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-disable --hwmon-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --multiply-accel-disable --self-test-disable --slow-candidates --brain-server --brain-server-timer --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password --identify"
local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --stdin-timeout-abort --markov-hcstat2 --markov-threshold --runtime --session --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --backend-devices --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-temp-abort --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment-min --increment-max --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-server-timer --brain-client-features --brain-host --brain-password --brain-port --brain-session --brain-session-whitelist"
local SHORT_OPTS="-m -a -V -h -b -t -T -o -p -c -d -D -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O -S -z -M -Y"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-json --status-timer --stdin-timeout-abort --machine-readable --loopback --markov-hcstat2 --markov-disable --markov-inverse --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --deprecated-check-disable --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --hash-info --backend-ignore-cuda --backend-ignore-opencl --backend-ignore-hip --backend-ignore-metal --backend-info --backend-devices --backend-devices-virtual --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-disable --hwmon-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --multiply-accel-disable --self-test-disable --slow-candidates --brain-server --brain-server-timer --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password --identify"
local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --stdin-timeout-abort --markov-hcstat2 --markov-threshold --runtime --session --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --backend-devices --backend-devices-virtual --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-temp-abort --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-func-sel --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment-min --increment-max --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-server-timer --brain-client-features --brain-host --brain-password --brain-port --brain-session --brain-session-whitelist"
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"

View File

@ -39,6 +39,8 @@ int backend_session_update_combinator (hashcat_ctx_t *hashcat_ctx);
int backend_session_update_mp (hashcat_ctx_t *hashcat_ctx);
int backend_session_update_mp_rl (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_l, const u32 css_cnt_r);
u32 backend_device_idx_real_from_virtual (const u32 device_idx, const u32 backend_devices_virtual);
void generate_source_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file);
void generate_cached_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *cache_dir, const char *device_name_chksum, char *cached_file, bool is_metal);
void generate_source_kernel_shared_filename (char *shared_dir, char *source_file);

View File

@ -628,6 +628,7 @@ typedef enum user_options_defaults
ADVICE_DISABLE = false,
ATTACK_MODE = ATTACK_MODE_STRAIGHT,
AUTODETECT = false,
BACKEND_DEVICES_VIRTUAL = 1,
BENCHMARK_ALL = false,
BENCHMARK = false,
BITMAP_MAX = 18,
@ -728,6 +729,7 @@ typedef enum user_options_map
IDX_ADVICE_DISABLE = 0xff00,
IDX_ATTACK_MODE = 'a',
IDX_BACKEND_DEVICES = 'd',
IDX_BACKEND_DEVICES_VIRTUAL = 'Y',
IDX_BACKEND_IGNORE_CUDA = 0xff01,
IDX_BACKEND_IGNORE_HIP = 0xff02,
IDX_BACKEND_IGNORE_METAL = 0xff03,
@ -1073,6 +1075,7 @@ typedef struct hashconfig
bool forced_jit_compile;
u32 pwdump_column;
} hashconfig_t;
typedef struct pw_pre
@ -1876,6 +1879,7 @@ typedef struct backend_ctx
int backend_device_from_opencl_platform[CL_PLATFORMS_MAX][DEVICES_MAX]; // from opencl device index to backend device index (by platform)
int backend_devices_cnt;
int backend_devices_virtual;
int backend_devices_active;
int cuda_devices_cnt;
@ -2396,6 +2400,7 @@ typedef struct user_options
const char *rule_buf_r;
const char *session;
u32 attack_mode;
u32 backend_devices_virtual;
u32 backend_info;
u32 bitmap_max;
u32 bitmap_min;

81
rules/stacking58.rule Normal file
View File

@ -0,0 +1,81 @@
## This rule file is designed to act as a base for usage in a rule stacking runs.
##
## For instance: $ hashcat hash.txt word.txt -r stacking58.rule -r stacking58.rule -r stacking58.rule
##
## This automatically produces a rule set of 195112 rules. These include well known efficient rules like:
##
## :
## $1
## $1 $3
## $1 $2 $3
## $!
## c $!
## ...
##
:
c
u
d
r
[
]
{
}
^0
^1
^2
^3
^4
^5
^6
^7
^8
^9
^
^!
^#
^%
^&
^*
^-
^.
^@
^^
^_
$0
$1
$2
$3
$4
$5
$6
$7
$8
$9
$
$!
$#
$%
$&
$*
$-
$.
$@
$^
$_
$$
sa@
se3
si!
si1
so0
ss$

10
rules/top10_2023.rule Normal file
View File

@ -0,0 +1,10 @@
:
$1
$1 $2
$1 $2 $3
c
u
$!
d
so0 si1 se3 ss$ sa@
$2 $0 $2 $3

View File

@ -617,6 +617,11 @@ static bool write_kernel_binary (hashcat_ctx_t *hashcat_ctx, const char *kernel_
return true;
}
u32 backend_device_idx_real_from_virtual (const u32 device_idx, const u32 backend_devices_virtual)
{
return device_idx / backend_devices_virtual;
}
void generate_source_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file)
{
if (opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
@ -4855,6 +4860,13 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
}
}
opencl_platform_devices_cnt *= user_options->backend_devices_virtual;
for (int i = opencl_platform_devices_cnt - 1; i >= 0; i--)
{
opencl_platform_devices[i] = opencl_platform_devices[backend_device_idx_real_from_virtual (i, user_options->backend_devices_virtual)];
}
opencl_platforms_devices[opencl_platforms_idx] = opencl_platform_devices;
opencl_platforms_devices_cnt[opencl_platforms_idx] = opencl_platform_devices_cnt;
}
@ -5025,6 +5037,8 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
cuda_close (hashcat_ctx);
}
cuda_devices_cnt *= user_options->backend_devices_virtual;
backend_ctx->cuda_devices_cnt = cuda_devices_cnt;
// device specific
@ -5033,6 +5047,8 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
{
const u32 device_id = backend_devices_idx;
const u32 cuda_devices_idx_real = backend_device_idx_real_from_virtual (cuda_devices_idx, user_options->backend_devices_virtual);
hc_device_param_t *device_param = &devices_param[backend_devices_idx];
device_param->device_id = device_id;
@ -5041,7 +5057,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
CUdevice cuda_device;
if (hc_cuDeviceGet (hashcat_ctx, &cuda_device, cuda_devices_idx) == -1)
if (hc_cuDeviceGet (hashcat_ctx, &cuda_device, cuda_devices_idx_real) == -1)
{
device_param->skipped = true;
@ -5432,6 +5448,8 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
hip_close (hashcat_ctx);
}
hip_devices_cnt *= user_options->backend_devices_virtual;
backend_ctx->hip_devices_cnt = hip_devices_cnt;
// device specific
@ -5440,6 +5458,8 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
{
const u32 device_id = backend_devices_idx;
const u32 hip_devices_idx_real = backend_device_idx_real_from_virtual (hip_devices_idx, user_options->backend_devices_virtual);
hc_device_param_t *device_param = &devices_param[backend_devices_idx];
device_param->device_id = device_id;
@ -5448,7 +5468,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
hipDevice_t hip_device;
if (hc_hipDeviceGet (hashcat_ctx, &hip_device, hip_devices_idx) == -1)
if (hc_hipDeviceGet (hashcat_ctx, &hip_device, hip_devices_idx_real) == -1)
{
device_param->skipped = true;
@ -5860,6 +5880,8 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
mtl_close (hashcat_ctx);
}
metal_devices_cnt *= user_options->backend_devices_virtual;
backend_ctx->metal_devices_cnt = metal_devices_cnt;
// device specific
@ -5868,6 +5890,8 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
{
const u32 device_id = backend_devices_idx;
const u32 metal_devices_idx_real = backend_device_idx_real_from_virtual (metal_devices_idx, user_options->backend_devices_virtual);
hc_device_param_t *device_param = &devices_param[backend_devices_idx];
device_param->device_id = device_id;
@ -5876,7 +5900,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
mtl_device_id metal_device = NULL;
if (hc_mtlDeviceGet (hashcat_ctx, &metal_device, metal_devices_idx) == -1)
if (hc_mtlDeviceGet (hashcat_ctx, &metal_device, metal_devices_idx_real) == -1)
{
device_param->skipped = true;

View File

@ -61,6 +61,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
static const char *SIGNATURE_PDF = "$pdf$";
@ -214,6 +216,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// validate data
pdf->P_minus = 0;
if (P_pos[0] == 0x2d) pdf->P_minus = 1;
const int V = strtol ((const char *) V_pos, NULL, 10);
const int R = strtol ((const char *) R_pos, NULL, 10);
const int P = strtol ((const char *) P_pos, NULL, 10);
@ -291,7 +297,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const pdf_t *pdf = (const pdf_t *) esalt_buf;
const int line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
const int line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
40,

View File

@ -63,6 +63,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
static const char *SIGNATURE_PDF = "$pdf$";
@ -235,6 +237,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// validate data
pdf->P_minus = 0;
if (P_pos[0] == 0x2d) pdf->P_minus = 1;
const int V = strtol ((const char *) V_pos, NULL, 10);
const int R = strtol ((const char *) R_pos, NULL, 10);
const int P = strtol ((const char *) P_pos, NULL, 10);
@ -312,7 +318,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
{
const pdf_t *pdf = (const pdf_t *) esalt_buf;
const int line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
const int line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
40,

View File

@ -62,6 +62,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
static const char *SIGNATURE_PDF = "$pdf$";
@ -222,6 +224,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// validate data
pdf->P_minus = 0;
if (P_pos[0] == 0x2d) pdf->P_minus = 1;
const int V = strtol ((const char *) V_pos, NULL, 10);
const int R = strtol ((const char *) R_pos, NULL, 10);
const int P = strtol ((const char *) P_pos, NULL, 10);
@ -322,7 +328,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *rc4key = (const u8 *) pdf->rc4key;
const int line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x:%02x%02x%02x%02x%02x";
const int line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
40,

View File

@ -62,6 +62,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
typedef struct pdf14_tmp
@ -245,6 +247,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// validate data
pdf->P_minus = 0;
if (P_pos[0] == 0x2d) pdf->P_minus = 1;
const int V = strtol ((const char *) V_pos, NULL, 10);
const int R = strtol ((const char *) R_pos, NULL, 10);
const int P = strtol ((const char *) P_pos, NULL, 10);
@ -379,7 +385,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
if (pdf->id_len == 32)
{
line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
128,
@ -416,7 +426,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
}
else
{
line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x";
line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
128,

View File

@ -69,6 +69,8 @@ typedef struct pdf
u32 rc4key[2];
u32 rc4data[2];
int P_minus;
} pdf_t;
typedef struct pdf14_tmp
@ -354,6 +356,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// validate data
pdf->P_minus = 0;
if (P_pos[0] == 0x2d) pdf->P_minus = 1;
const int V = strtol ((const char *) V_pos, NULL, 10);
const int R = strtol ((const char *) R_pos, NULL, 10);
const int P = strtol ((const char *) P_pos, NULL, 10);
@ -568,9 +574,14 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
int line_len = 0;
pdf_t *pdf = (pdf_t *) esalt_buf;
if (pdf->id_len == 32)
{
line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
128,
@ -608,7 +619,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
}
else
{
line_len = snprintf (line_buf, line_size, "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s",
char *line_format = "$pdf$%d*%d*%d*%u*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
if (pdf->P_minus == 1) line_format = "$pdf$%d*%d*%d*%d*%d*%d*%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x*%d*%08x%08x%08x%08x%08x%08x%08x%08x%s";
line_len = snprintf (line_buf, line_size, line_format,
pdf->V,
pdf->R,
128,

View File

@ -99,6 +99,7 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
" --backend-ignore-opencl | | Do not try to open OpenCL interface on startup |",
" -I, --backend-info | | Show system/evironment/backend API info | -I or -II",
" -d, --backend-devices | Str | Backend devices to use, separated with commas | -d 1",
" -Y, --backend-devices-virtual | Num | Spawn X virtual instances for each real device | -Y 8",
" -D, --opencl-device-types | Str | OpenCL device-types to use, separated with commas | -D 1",
" -O, --optimized-kernel-enable | | Enable optimized kernels (limits password length) |",
" -M, --multiply-accel-disable | | Disable multiply kernel-accel with processor count |",

View File

@ -21,9 +21,9 @@
#endif
#ifdef WITH_BRAIN
static const char *const short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSz";
static const char *const short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSY:z";
#else
static const char *const short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMS";
static const char *const short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:T:c:p:s:l:1:2:3:4:iIbw:OMSY:";
#endif
static char *const SEPARATOR = ":";
@ -33,6 +33,7 @@ static const struct option long_options[] =
{"advice-disable", no_argument, NULL, IDX_ADVICE_DISABLE},
{"attack-mode", required_argument, NULL, IDX_ATTACK_MODE},
{"backend-devices", required_argument, NULL, IDX_BACKEND_DEVICES},
{"backend-devices-virtual", required_argument, NULL, IDX_BACKEND_DEVICES_VIRTUAL},
{"backend-ignore-cuda", no_argument, NULL, IDX_BACKEND_IGNORE_CUDA},
{"backend-ignore-hip", no_argument, NULL, IDX_BACKEND_IGNORE_HIP},
#if defined (__APPLE__)
@ -171,6 +172,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->attack_mode = ATTACK_MODE;
user_options->autodetect = AUTODETECT;
user_options->backend_devices = NULL;
user_options->backend_devices_virtual = BACKEND_DEVICES_VIRTUAL;
user_options->backend_ignore_cuda = BACKEND_IGNORE_CUDA;
user_options->backend_ignore_hip = BACKEND_IGNORE_HIP;
#if defined (__APPLE__)
@ -353,6 +355,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_INCREMENT_MIN:
case IDX_INCREMENT_MAX:
case IDX_HOOK_THREADS:
case IDX_BACKEND_DEVICES_VIRTUAL:
#ifdef WITH_BRAIN
case IDX_BRAIN_PORT:
#endif
@ -467,6 +470,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_BACKEND_IGNORE_OPENCL: user_options->backend_ignore_opencl = true; break;
case IDX_BACKEND_INFO: user_options->backend_info++; break;
case IDX_BACKEND_DEVICES: user_options->backend_devices = optarg; break;
case IDX_BACKEND_DEVICES_VIRTUAL: user_options->backend_devices_virtual = hc_strtoul (optarg, NULL, 10); break;
case IDX_BACKEND_VECTOR_WIDTH: user_options->backend_vector_width = hc_strtoul (optarg, NULL, 10);
user_options->backend_vector_width_chgd = true; break;
case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break;
@ -559,7 +563,7 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
#ifdef WITH_BRAIN
#ifdef WITH_BRAIN
if ((user_options->brain_client == true) && (user_options->brain_server == true))
{
event_log_error (hashcat_ctx, "Can not have --brain-client and --brain-server at the same time.");
@ -612,17 +616,20 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
if (user_options->separator_chgd == true)
{
bool error = false;
if ((strlen (user_options->separator) != 1) && (strlen (user_options->separator) != 4))
{
error = true;
}
if (strlen (user_options->separator) == 4)
{
if ((user_options->separator[0] == '0') && (user_options->separator[1] == 'x'))
{
if (is_valid_hex_string ((u8 * ) (&(user_options->separator[2])), 2))
if (is_valid_hex_string ((u8 *) (&(user_options->separator[2])), 2))
{
u8 sep = hex_to_u8 ((u8 * ) (&(user_options->separator[2])));
u8 sep = hex_to_u8 ((u8 *) (&(user_options->separator[2])));
user_options->separator[0] = sep;
user_options->separator[1] = 0;
}
@ -631,7 +638,8 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
error = true;
}
}
else{
else
{
error = true;
}
}
@ -738,6 +746,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if (user_options->backend_devices_virtual == 0)
{
event_log_error (hashcat_ctx, "Invalid --backend-devices-virtual value specified.");
return -1;
}
if (user_options->outfile_format == 0)
{
event_log_error (hashcat_ctx, "Invalid --outfile-format value specified.");
@ -2058,6 +2073,11 @@ void user_options_info (hashcat_ctx_t *hashcat_ctx)
event_log_info (hashcat_ctx, "* --backend-devices=%s", user_options->backend_devices);
}
if (user_options->backend_devices_virtual)
{
event_log_info (hashcat_ctx, "* --backend-devices-virtual=%u", user_options->backend_devices_virtual);
}
if (user_options->opencl_device_types)
{
event_log_info (hashcat_ctx, "* --opencl-device-types=%s", user_options->opencl_device_types);
@ -2117,6 +2137,11 @@ void user_options_info (hashcat_ctx_t *hashcat_ctx)
event_log_info (hashcat_ctx, "# option: --backend-devices=%s", user_options->backend_devices);
}
if (user_options->backend_devices_virtual)
{
event_log_info (hashcat_ctx, "# option: --backend-devices-virtual=%u", user_options->backend_devices_virtual);
}
if (user_options->opencl_device_types)
{
event_log_info (hashcat_ctx, "# option: --opencl-device-types=%s", user_options->opencl_device_types);
@ -3147,6 +3172,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_uint64 (user_options->limit);
logfile_top_uint64 (user_options->skip);
logfile_top_uint (user_options->attack_mode);
logfile_top_uint (user_options->backend_devices_virtual);
logfile_top_uint (user_options->benchmark);
logfile_top_uint (user_options->benchmark_all);
logfile_top_uint (user_options->bitmap_max);

View File

@ -165,12 +165,26 @@ Tesla_P4 ALIAS_nv_sm50_or_higher
Tesla_P40 ALIAS_nv_sm50_or_higher
Tesla_P100 ALIAS_nv_sm50_or_higher
Tesla_V100 ALIAS_nv_sm50_or_higher
Tesla_T4 ALIAS_nv_sm50_or_higher
L4 ALIAS_nv_sm50_or_higher
A100-SXM4-40GB ALIAS_nv_sm50_or_higher
A100-SXM4-80GB ALIAS_nv_sm50_or_higher
A100-PCIE-40GB ALIAS_nv_sm50_or_higher
A100-PCIE-80GB ALIAS_nv_sm50_or_higher
Quadro_M2000 ALIAS_nv_sm50_or_higher
Quadro_M4000 ALIAS_nv_sm50_or_higher
Quadro_M5000 ALIAS_nv_sm50_or_higher
Quadro_M6000 ALIAS_nv_sm50_or_higher
Quadro_RTX_4000 ALIAS_nv_sm50_or_higher
Quadro_RTX_5000 ALIAS_nv_sm50_or_higher
Quadro_RTX_6000 ALIAS_nv_sm50_or_higher
RTX_A6000 ALIAS_nv_sm50_or_higher
TITAN_X ALIAS_nv_sm50_or_higher
TITAN_Xp ALIAS_nv_sm50_or_higher
TITAN_V ALIAS_nv_sm50_or_higher
@ -240,6 +254,8 @@ GeForce_RTX_4070_Ti ALIAS_nv_sm50_or_higher
GeForce_RTX_4080 ALIAS_nv_sm50_or_higher
GeForce_RTX_4090 ALIAS_nv_sm50_or_higher
##
## Unmapped GPU
##

View File

@ -20,6 +20,7 @@ Each file in this folder with the filename suffix .hctune will be automatically
- Invalid lines are ignored
- The Device-Name is the OpenCL Device-Name. It's shown on hashcat startup.
- If the device contains spaces, replace all spaces with _ character.
- Device Names prefixed with 'NVIDIA' will be matched with or without 'NVIDIA' present in the alias. e.g. 'NVIDIA_Tesla_T4' vs 'Tesla_T4'
- The Device-Name can be assigned an alias. This is useful if many devices share the same chip
- If you assign an alias, make sure to not use the devices name directly
- There's also a hard-wired Device-Name which matches all device types called: