1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-21 23:58:07 +00:00

Hardware Monitor: Renamed --gpu-temp-abort to --hwmon-temp-abort

Hardware Monitor: Renamed --gpu-temp-disable to --hwmon-disable
Fixed invalid warnings about throttling in case --hwmon-disable was used
Fixes https://github.com/hashcat/hashcat/issues/1757
This commit is contained in:
Jens Steube 2018-11-09 12:48:27 +01:00
parent a96db32e96
commit 2aff01b20e
9 changed files with 59 additions and 62 deletions

View File

@ -1,4 +1,4 @@
* changes v5.0.0 -> v5.0.1
* changes v5.0.0 -> v5.1.0
##
## Features
@ -27,10 +27,12 @@
## Improvements
##
- Depencies: Removed gitmodules xxHash and OpenCL-Headers
- Depencies: Added xxHash and OpenCL-Headers to deps/ in order to allow building hashcat from GitHub source release package
- Memory: Reduced default maximum bitmap size from 24 to 18 and give a notice to use --bitmap-max to restore
- Depencies: Removed gitmodules xxHash and OpenCL-Headers
- Hardware Monitor: Renamed --gpu-temp-abort to --hwmon-temp-abort
- Hardware Monitor: Renamed --gpu-temp-disable to --hwmon-disable
- Memory: Limit maximum host memory to allocate depending on bitness
- Memory: Reduced default maximum bitmap size from 24 to 18 and give a notice to use --bitmap-max to restore
- Tests: Added hash-mode 11700 (Streebog-256)
- Tests: Added hash-mode 11750 (HMAC-Streebog-256 (key = $pass), big-endian)
- Tests: Added hash-mode 11760 (HMAC-Streebog-256 (key = $salt), big-endian)
@ -58,15 +60,16 @@
## Bugs
##
- Fixed status output of progress value in case -S and -l used in combination
- Fixed calculation of brain-attack if a given wordlist has the size zero
- Fixed automated calculation of brain-session when not using all hashes in the hashlist
- Fixed calculation of brain-attack if a given wordlist has the size zero
- Fixed checking the length of the last token in a hash if it was given the attribute TOKEN_ATTR_FIXED_LENGTH
- Fixed endianness and invalid separator character in outfile format for hash-mode 16801 (WPA-PMKID-PMK)
- Fixed ignoring --brain-client-features configuration when brain-server has attack positions information from a previous run
- Fixed invalid warnings about throttling in case --hwmon-disable was used
- Fixed missing call to WSACleanup() to cleanly shutdown windows sockets system
- Fixed missing call to WSAStartup() and client indexing in order to start the brain server on Windows
- Fixed checking the length of the last token in a hash if it was given the attribute TOKEN_ATTR_FIXED_LENGTH
- Fixed out-of-bounds write in short-term memory of the brain-server
- Fixed status output of progress value in case -S and -l used in combination
* changes v4.2.1 -> v5.0.0

View File

@ -189,8 +189,8 @@ _hashcat ()
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H'
local SHORT_OPTS="-m -a -V -v -h -b -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O -S -z"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat2 --markov-disable --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 --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 --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable --slow-candidates --brain-server --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password"
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 --markov-hcstat2 --markov-threshold --runtime --session --timer --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 --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --nvidia-spin-damp --gpu-temp-abort --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-host --brain-password --brain-port --brain-session --brain-whitelist-session --stdin-timeout-abort"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat2 --markov-disable --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 --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 --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --nvidia-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-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable --slow-candidates --brain-server --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password"
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 --markov-hcstat2 --markov-threshold --runtime --session --timer --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 --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --nvidia-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-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-host --brain-password --brain-port --brain-session --brain-whitelist-session --stdin-timeout-abort"
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
@ -361,7 +361,7 @@ _hashcat ()
-t|-p|-c|-j|-k|-g| \
--status-timer|--markov-threshold|--runtime|--session|--separator|--segment-size|--rule-left|--rule-right| \
--nvidia-spin-damp|--gpu-temp-abort|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \
--nvidia-spin-damp|--hwmon-temp-abort|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \
--increment-min|--increment-max|--remove-timer|--bitmap-min|--bitmap-max|--skip|--limit|--generate-rules-seed| \
--outfile-check-timer|--outfile-check-dir|--induction-dir|--scrypt-tmto|--encoding-from|--encoding-to|--optimized-kernel-enable|--brain-host|--brain-port|--brain-password|--stdin-timeout-abort)
return 0

View File

@ -547,8 +547,8 @@ typedef enum user_options_defaults
DEBUG_MODE = 0,
EXAMPLE_HASHES = false,
FORCE = false,
GPU_TEMP_ABORT = 90,
GPU_TEMP_DISABLE = false,
HWMON_DISABLE = false,
HWMON_TEMP_ABORT = 90,
HASH_MODE = 0,
HCCAPX_MESSAGE_PAIR = 0,
HEX_CHARSET = false,
@ -640,8 +640,8 @@ typedef enum user_options_map
IDX_ENCODING_TO = 0xff0f,
IDX_EXAMPLE_HASHES = 0xff10,
IDX_FORCE = 0xff11,
IDX_GPU_TEMP_ABORT = 0xff12,
IDX_GPU_TEMP_DISABLE = 0xff13,
IDX_HWMON_DISABLE = 0xff12,
IDX_HWMON_TEMP_ABORT = 0xff13,
IDX_HASH_MODE = 'm',
IDX_HCCAPX_MESSAGE_PAIR = 0xff14,
IDX_HELP = 'h',
@ -1707,7 +1707,7 @@ typedef struct user_options
#endif
bool example_hashes;
bool force;
bool gpu_temp_disable;
bool hwmon_disable;
bool hex_charset;
bool hex_salt;
bool hex_wordlist;
@ -1779,7 +1779,7 @@ typedef struct user_options
u32 brain_attack;
#endif
u32 debug_mode;
u32 gpu_temp_abort;
u32 hwmon_temp_abort;
u32 hash_mode;
u32 hccapx_message_pair;
u32 increment_max;

View File

@ -2018,6 +2018,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->stdout_flag == true) return 0;
if (user_options->usage == true) return 0;
if (user_options->version == true) return 0;
if (user_options->hwmon_disable == true) return 0;
hwmon_ctx->hm_device = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t));

View File

@ -531,9 +531,9 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx,
event_log_info (hashcat_ctx, "Watchdog: Hardware monitoring interface not found on your system.");
}
if (hwmon_ctx->enabled == true && user_options->gpu_temp_abort > 0)
if (hwmon_ctx->enabled == true && user_options->hwmon_temp_abort > 0)
{
event_log_info (hashcat_ctx, "Watchdog: Temperature abort trigger set to %uc", user_options->gpu_temp_abort);
event_log_info (hashcat_ctx, "Watchdog: Temperature abort trigger set to %uc", user_options->hwmon_temp_abort);
}
else
{

View File

@ -112,10 +112,28 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
if (status_ctx->devices_status == STATUS_INIT) continue;
if (hwmon_check == true)
if (hwmon_ctx->enabled == true)
{
hc_thread_mutex_lock (status_ctx->mux_hwmon);
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
{
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
if (device_param->skipped == true) continue;
if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
const int temperature = hm_get_temperature_with_device_id (hashcat_ctx, device_id);
if (temperature > (int) user_options->hwmon_temp_abort)
{
EVENT_DATA (EVENT_MONITOR_TEMP_ABORT, &device_id, sizeof (u32));
myabort (hashcat_ctx);
}
}
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
{
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
@ -136,32 +154,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
}
else
{
slowdown_warnings = 0;
}
}
hc_thread_mutex_unlock (status_ctx->mux_hwmon);
}
if (hwmon_check == true && user_options->gpu_temp_disable == false)
{
hc_thread_mutex_lock (status_ctx->mux_hwmon);
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
{
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
if (device_param->skipped == true) continue;
if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
const int temperature = hm_get_temperature_with_device_id (hashcat_ctx, device_id);
if (temperature > (int) user_options->gpu_temp_abort)
{
EVENT_DATA (EVENT_MONITOR_TEMP_ABORT, &device_id, sizeof (u32));
myabort (hashcat_ctx);
if (slowdown_warnings > 0) slowdown_warnings--;
}
}

View File

@ -97,8 +97,8 @@ static const char *const USAGE_BIG[] =
" -u, --kernel-loops | Num | Manual workload tuning, set innerloop step size to X | -u 256",
" -T, --kernel-threads | Num | Manual workload tuning, set thread count to X | -T 64",
" --nvidia-spin-damp | Num | Workaround NVIDIAs CPU burning loop bug, in percent | --nvidia-spin-damp=50",
" --gpu-temp-disable | | Disable temperature and fanspeed reads and triggers |",
" --gpu-temp-abort | Num | Abort if GPU temperature reaches X degrees Celsius | --gpu-temp-abort=100",
" --hwmon-disable | | Disable temperature and fanspeed reads and triggers |",
" --hwmon-temp-abort | Num | Abort if temperature reaches X degrees Celsius | --hwmon-temp-abort=100",
" --scrypt-tmto | Num | Manually override TMTO value for scrypt to X | --scrypt-tmto=3",
" -s, --skip | Num | Skip X words from the start | -s 1000000",
" -l, --limit | Num | Limit X words from the start + skipped words | -l 1000000",

View File

@ -47,8 +47,8 @@ static const struct option long_options[] =
{"generate-rules-func-min", required_argument, NULL, IDX_RP_GEN_FUNC_MIN},
{"generate-rules", required_argument, NULL, IDX_RP_GEN},
{"generate-rules-seed", required_argument, NULL, IDX_RP_GEN_SEED},
{"gpu-temp-abort", required_argument, NULL, IDX_GPU_TEMP_ABORT},
{"gpu-temp-disable", no_argument, NULL, IDX_GPU_TEMP_DISABLE},
{"hwmon-disable", no_argument, NULL, IDX_HWMON_DISABLE},
{"hwmon-temp-abort", required_argument, NULL, IDX_HWMON_TEMP_ABORT},
{"hash-type", required_argument, NULL, IDX_HASH_MODE},
{"hccapx-message-pair", required_argument, NULL, IDX_HCCAPX_MESSAGE_PAIR},
{"help", no_argument, NULL, IDX_HELP},
@ -173,8 +173,8 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->encoding_to = ENCODING_TO;
user_options->example_hashes = EXAMPLE_HASHES;
user_options->force = FORCE;
user_options->gpu_temp_abort = GPU_TEMP_ABORT;
user_options->gpu_temp_disable = GPU_TEMP_DISABLE;
user_options->hwmon_disable = HWMON_DISABLE;
user_options->hwmon_temp_abort = HWMON_TEMP_ABORT;
user_options->hash_mode = HASH_MODE;
user_options->hccapx_message_pair = HCCAPX_MESSAGE_PAIR;
user_options->hex_charset = HEX_CHARSET;
@ -306,7 +306,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_KERNEL_LOOPS:
case IDX_KERNEL_THREADS:
case IDX_NVIDIA_SPIN_DAMP:
case IDX_GPU_TEMP_ABORT:
case IDX_HWMON_TEMP_ABORT:
case IDX_HCCAPX_MESSAGE_PAIR:
case IDX_NONCE_ERROR_CORRECTIONS:
case IDX_VERACRYPT_PIM:
@ -434,8 +434,8 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
user_options->kernel_threads_chgd = true; break;
case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = hc_strtoul (optarg, NULL, 10);
user_options->nvidia_spin_damp_chgd = true; break;
case IDX_GPU_TEMP_DISABLE: user_options->gpu_temp_disable = true; break;
case IDX_GPU_TEMP_ABORT: user_options->gpu_temp_abort = hc_strtoul (optarg, NULL, 10); break;
case IDX_HWMON_DISABLE: user_options->hwmon_disable = true; break;
case IDX_HWMON_TEMP_ABORT: user_options->hwmon_temp_abort = hc_strtoul (optarg, NULL, 10); break;
case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break;
case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = hc_strtoul (optarg, NULL, 10);
user_options->hccapx_message_pair_chgd = true; break;
@ -1434,7 +1434,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
if (user_options->stdout_flag)
{
user_options->gpu_temp_disable = true;
user_options->hwmon_disable = true;
user_options->left = false;
user_options->logfile_disable = true;
user_options->nvidia_spin_damp = 0;
@ -1456,7 +1456,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|| user_options->speed_only == true
|| user_options->progress_only == true)
{
user_options->gpu_temp_disable = true;
user_options->hwmon_disable = true;
user_options->left = false;
user_options->logfile_disable = true;
user_options->nvidia_spin_damp = 0;
@ -1478,7 +1478,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true)
{
user_options->attack_mode = ATTACK_MODE_BF;
user_options->gpu_temp_disable = false;
user_options->hwmon_disable = true;
user_options->increment = false;
user_options->left = false;
user_options->logfile_disable = true;
@ -1617,12 +1617,12 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
}
#if !defined (WITH_HWMON)
user_options->gpu_temp_disable = true;
user_options->hwmon_disable = true;
#endif // WITH_HWMON
if (user_options->gpu_temp_disable == true)
if (user_options->hwmon_disable == true)
{
user_options->gpu_temp_abort = 0;
user_options->hwmon_temp_abort = 0;
}
// default mask
@ -2597,8 +2597,8 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_uint (user_options->debug_mode);
logfile_top_uint (user_options->example_hashes);
logfile_top_uint (user_options->force);
logfile_top_uint (user_options->gpu_temp_abort);
logfile_top_uint (user_options->gpu_temp_disable);
logfile_top_uint (user_options->hwmon_disable);
logfile_top_uint (user_options->hwmon_temp_abort);
logfile_top_uint (user_options->hash_mode);
logfile_top_uint (user_options->hex_charset);
logfile_top_uint (user_options->hex_salt);

View File

@ -27,7 +27,7 @@ SLOW_ALGOS="400 500 501 1600 1800 2100 2500 3200 5200 5800 6211 6212 6213 6221 6
# List of VeraCrypt modes which have test containers
VC_MODES="13711 13712 13713 13721 13722 13723 13731 13732 13733 13751 13752 13753 13771 13772 13773"
OPTS="--quiet --force --potfile-disable --runtime 400 --gpu-temp-disable"
OPTS="--quiet --force --potfile-disable --runtime 400 --hwmon-disable"
OUTD="test_$(date +%s)"