Skip to content

Commit

Permalink
Added tunings/ folder in order to replace hashcat.hctune. Configurati…
Browse files Browse the repository at this point in the history
…on files with *.hctune suffix are automatically load on startup
  • Loading branch information
jsteube committed Aug 8, 2022
1 parent 7668ec5 commit c8350eb
Show file tree
Hide file tree
Showing 21 changed files with 437 additions and 452 deletions.
1 change: 1 addition & 0 deletions docs/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- Added support to use 'John the Ripper' hash format with hash-type 18200
- Added the hash extraction scripts from the tools folder also to beta/release versions
- Added user advice if a hash throws 'token length exception'
- Added tunings/ folder in order to replace hashcat.hctune. Configuration files with *.hctune suffix are automatically load on startup

##
## Bugs
Expand Down
2 changes: 1 addition & 1 deletion include/tuningdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>

#define TUNING_DB_FILE "hashcat.hctune"
#define TUNING_DB_SUFFIX "hctune"

int sort_by_tuning_db_alias (const void *v1, const void *v2);
int sort_by_tuning_db_entry (const void *v1, const void *v2);
Expand Down
11 changes: 8 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@ endif

.PHONY: install
ifeq ($(SHARED),1)
install: install_docs install_shared install_library install_library_dev install_kernels install_modules install_hashcat
install: install_docs install_shared install_library install_library_dev install_tunings install_kernels install_modules install_hashcat
else
install: install_docs install_shared install_kernels install_modules install_hashcat
install: install_docs install_shared install_tunings install_kernels install_modules install_hashcat
endif

# we need this extra target to make sure that for parallel builds (i.e. 2+ Makefile targets could possible run at the same time)
Expand Down Expand Up @@ -560,9 +560,14 @@ install_docs: install_make_shared_root
.PHONY: install_shared
install_shared: install_make_shared_root
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)
$(INSTALL) -m 644 hashcat.hctune $(DESTDIR)$(SHARED_FOLDER)/
$(INSTALL) -m 644 hashcat.hcstat2 $(DESTDIR)$(SHARED_FOLDER)/

.PHONY: install_tunings
install_tunings: install_shared
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/tunings
$(FIND) tunings/ -mindepth 1 -type d -execdir $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/tunings/{} \;
$(FIND) tunings/ -mindepth 1 -type f -execdir $(INSTALL) -m 644 {} $(DESTDIR)$(SHARED_FOLDER)/tunings/{} \;

.PHONY: install_kernels
install_kernels: install_shared
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL
Expand Down
45 changes: 1 addition & 44 deletions src/modules/module_08900.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,49 +391,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
return line_len;
}

/*
Find the right -n value for your GPU:
=====================================
1. For example, to find the value for 8900, first create a valid hash for 8900 as follows:
$ ./hashcat --example-hashes -m 8900 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.8900
2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer.
$ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.8900 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 8900 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x
3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning.
$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail
4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n
*/

const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const char *extra_tuningdb_block =
"DEVICE_TYPE_CPU * 8900 1 N A\n"
"DEVICE_TYPE_GPU * 8900 1 N A\n"
"GeForce_GTX_980 * 8900 1 29 A\n"
"GeForce_GTX_1080 * 8900 1 15 A\n"
"GeForce_RTX_2080_Ti * 8900 1 68 A\n"
"GeForce_RTX_3060_Ti * 8900 1 51 A\n"
"GeForce_RTX_3070 * 8900 1 46 A\n"
"GeForce_RTX_3090 * 8900 1 82 A\n"
"GeForce_RTX_3090_Ti * 8900 1 84 A\n"
"NVS_510 * 8900 1 12 A\n"
"ALIAS_AMD_RX480 * 8900 1 15 A\n"
"ALIAS_AMD_Vega64 * 8900 1 30 A\n"
"ALIAS_AMD_MI100 * 8900 1 79 A\n"
"ALIAS_AMD_RX6900XT * 8900 1 123 A\n"
;

return extra_tuningdb_block;
}

void module_init (module_ctx_t *module_ctx)
{
module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT;
Expand All @@ -457,7 +414,7 @@ void module_init (module_ctx_t *module_ctx)
module_ctx->module_esalt_size = MODULE_DEFAULT;
module_ctx->module_extra_buffer_size = module_extra_buffer_size;
module_ctx->module_extra_tmp_size = module_extra_tmp_size;
module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block;
module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT;
module_ctx->module_forced_outfile_format = MODULE_DEFAULT;
module_ctx->module_hash_binary_count = MODULE_DEFAULT;
module_ctx->module_hash_binary_parse = MODULE_DEFAULT;
Expand Down
43 changes: 1 addition & 42 deletions src/modules/module_09300.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,47 +348,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
return line_len;
}

/*
Find the right -n value for your GPU:
=====================================
1. For example, to find the value for 9300, first create a valid hash for 9300 as follows:
$ ./hashcat --example-hashes -m 9300 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.9300
2. Now let it iterate through all -n values to a certain point. In this case, I'm using 1032, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer.
$ export i=8; while [ $i -ne 1032 ]; do echo $i; ./hashcat --quiet tmp.hash.9300 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 9300 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+8)); done | tee x
3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning.
$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail
4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n
*/

const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const char *extra_tuningdb_block =
"DEVICE_TYPE_CPU * 9300 1 N A\n"
"DEVICE_TYPE_GPU * 9300 1 N A\n"
"GeForce_GTX_980 * 9300 1 128 A\n"
"GeForce_GTX_1080 * 9300 1 256 A\n"
"GeForce_RTX_2080_Ti * 9300 1 528 A\n"
"GeForce_RTX_3060_Ti * 9300 1 256 A\n"
"GeForce_RTX_3070 * 9300 1 368 A\n"
"GeForce_RTX_3090 * 9300 1 984 A\n"
"ALIAS_AMD_RX480 * 9300 1 232 A\n"
"ALIAS_AMD_Vega64 * 9300 1 440 A\n"
"ALIAS_AMD_MI100 * 9300 1 1000 A\n"
"ALIAS_AMD_RX6900XT * 9300 1 720 A\n"
;

return extra_tuningdb_block;
}

void module_init (module_ctx_t *module_ctx)
{
module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT;
Expand All @@ -412,7 +371,7 @@ void module_init (module_ctx_t *module_ctx)
module_ctx->module_esalt_size = MODULE_DEFAULT;
module_ctx->module_extra_buffer_size = module_extra_buffer_size;
module_ctx->module_extra_tmp_size = module_extra_tmp_size;
module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block;
module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT;
module_ctx->module_forced_outfile_format = MODULE_DEFAULT;
module_ctx->module_hash_binary_count = MODULE_DEFAULT;
module_ctx->module_hash_binary_parse = MODULE_DEFAULT;
Expand Down
44 changes: 1 addition & 43 deletions src/modules/module_15700.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,48 +454,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
return line_len;
}

/*
Find the right -n value for your GPU:
=====================================
1. For example, to find the value for 15700, first create a valid hash for 15700 as follows:
$ ./hashcat --example-hashes -m 15700 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.15700
2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer.
$ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.15700 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 15700 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x
3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning.
$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail
4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n
*/

const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const char *extra_tuningdb_block =
"DEVICE_TYPE_CPU * 15700 1 N A\n"
"DEVICE_TYPE_GPU * 15700 1 1 A\n"
"GeForce_GTX_980 * 15700 1 24 A\n"
"GeForce_GTX_1080 * 15700 1 28 A\n"
"GeForce_RTX_2080_Ti * 15700 1 68 A\n"
"GeForce_RTX_3060_Ti * 15700 1 11 A\n"
"GeForce_RTX_3070 * 15700 1 22 A\n"
"GeForce_RTX_3090 * 15700 1 82 A\n"
"GeForce_RTX_3090_Ti * 22700 1 84 A\n"
"ALIAS_AMD_RX480 * 15700 1 58 A\n"
"ALIAS_AMD_Vega64 * 15700 1 53 A\n"
"ALIAS_AMD_MI100 * 15700 1 120 A\n"
"ALIAS_AMD_RX6900XT * 15700 1 56 A\n"
;

return extra_tuningdb_block;
}

void module_init (module_ctx_t *module_ctx)
{
module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT;
Expand All @@ -519,7 +477,7 @@ void module_init (module_ctx_t *module_ctx)
module_ctx->module_esalt_size = module_esalt_size;
module_ctx->module_extra_buffer_size = module_extra_buffer_size;
module_ctx->module_extra_tmp_size = module_extra_tmp_size;
module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block;
module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT;
module_ctx->module_forced_outfile_format = MODULE_DEFAULT;
module_ctx->module_hash_binary_count = MODULE_DEFAULT;
module_ctx->module_hash_binary_parse = MODULE_DEFAULT;
Expand Down
45 changes: 1 addition & 44 deletions src/modules/module_22700.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,49 +393,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
return line_len;
}

/*
Find the right -n value for your GPU:
=====================================
1. For example, to find the value for 22700, first create a valid hash for 22700 as follows:
$ ./hashcat --example-hashes -m 22700 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.22700
2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer.
$ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.22700 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 22700 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x
3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning.
$ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail
4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n
*/

const char *module_extra_tuningdb_block (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const char *extra_tuningdb_block =
"DEVICE_TYPE_CPU * 22700 1 N A\n"
"DEVICE_TYPE_GPU * 22700 1 N A\n"
"GeForce_GTX_980 * 22700 1 29 A\n"
"GeForce_GTX_1080 * 22700 1 15 A\n"
"GeForce_RTX_2080_Ti * 22700 1 68 A\n"
"GeForce_RTX_3060_Ti * 22700 1 51 A\n"
"GeForce_RTX_3070 * 22700 1 46 A\n"
"GeForce_RTX_3090 * 22700 1 82 A\n"
"GeForce_RTX_3090_Ti * 22700 1 84 A\n"
"NVS_510 * 22700 1 12 A\n"
"ALIAS_AMD_RX480 * 22700 1 15 A\n"
"ALIAS_AMD_Vega64 * 22700 1 30 A\n"
"ALIAS_AMD_MI100 * 22700 1 79 A\n"
"ALIAS_AMD_RX6900XT * 22700 1 123 A\n"
;

return extra_tuningdb_block;
}

void module_init (module_ctx_t *module_ctx)
{
module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT;
Expand All @@ -459,7 +416,7 @@ void module_init (module_ctx_t *module_ctx)
module_ctx->module_esalt_size = MODULE_DEFAULT;
module_ctx->module_extra_buffer_size = module_extra_buffer_size;
module_ctx->module_extra_tmp_size = module_extra_tmp_size;
module_ctx->module_extra_tuningdb_block = module_extra_tuningdb_block;
module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT;
module_ctx->module_forced_outfile_format = MODULE_DEFAULT;
module_ctx->module_hash_binary_count = MODULE_DEFAULT;
module_ctx->module_hash_binary_parse = MODULE_DEFAULT;
Expand Down
Loading

0 comments on commit c8350eb

Please sign in to comment.