1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-08-04 04:48:12 +00:00
Commit Graph

260 Commits

Author SHA1 Message Date
hashcat-bot
b5b0dd7266
Merge branch 'master' into fix_bitmap-max 2025-07-09 10:27:37 +02:00
hashcat-bot
1a0d663c11
Merge pull request #4102 from matrix/show-restore-segfault
do not allow --show and --restore
2025-07-09 09:51:41 +02:00
hashcat-bot
c4c01868d0
Merge pull request #4103 from matrix/stdout_slow-candidates
do not allow --stdout and --slow-candidates
2025-07-09 09:50:09 +02:00
Gabriele Gristina
9f3d771137
fix build error on src/user_options.c 2025-07-06 07:59:56 +02:00
Gabriele Gristina
fba89b6888
Merge branch 'master' into hashInfo2int 2025-07-06 07:54:05 +02:00
Jens Steube
0df156e4c1
Merge branch 'master' into totalcandidates 2025-07-05 22:51:27 +02:00
Gabriele Gristina
904da431ae
Merge remote-tracking branch 'upstream/master' into hashInfo2int 2025-06-28 11:13:45 +02:00
Gabriele Gristina
fcc2844880
do not allow --benchmark and --backend-info 2025-06-26 22:12:50 +02:00
Jens Steube
58fa783095 Enhanced the auto-tune engine: when a kernel runs with a single thread and no accel, it should finish quickly (ideally under 1 ms). If it doesn't, the kernel is likely overloaded with code. If such a kernel also uses barriers (e.g., to load shared storage with multiple threads), high iteration counts cause unnecessary thread waiting. To address this, we now skip increasing the loop count if the runtime exceeds either 1/8 of the target time (based on the -w setting) or a hard-coded threshold of 4 ms.
Improved shared memory handling for -m 10700. Removed the hard-coded limit of 256 threads and now dynamically check the device's shared memory pool to adapt threads accordingly.
Implemented a feature request to display non-default session names early during startup.
Added a check for the number of registers required by a kernel (CUDA and HIP only). This allows us to estimate the max threads per block before entering the auto-tune engine and make pre-adjustments.
Fixed Metal command encoder argument to work with the new auto-tuner's extra kernel invocation.
Fixed incorrect host memory calculation logic during automatic kernel-accel reduction for scrypt-based algorithms. This ensures memory constraints are respected.
Improved several plugins by setting maximum loop counts and others using the OPTS_TYPE_NATIVE_THREADS option.
Fixed compilation on Apple platforms by excluding '#include <sys/sysinfo.h>'.
2025-06-25 22:10:29 +02:00
Gabriele Gristina
0720d20cf3
fix memory leaks 2025-06-22 21:47:28 +02:00
Jens Steube
ed10e6a913 Autotune and Benchmark refactoring
This change affects three key areas, each improving autotuning:

- Autotune refactoring itself

The main autotune algorithm had become too complex to maintain and has
now been rewritten from scratch. The engine is now closer to the old
v6.0.0 version, using a much more straightforward approach.

Additionally, the backend is now informed when the autotune engine runs
its operations and runs an extra invisible kernel invocation. This
significantly improves runtime accuracy because the same caching
mechanisms which kick in normal cracking sessions now also apply during
autotuning. This leads to more consistent and reliable automatic
workload tuning.

- Benchmarking and '--speed-only' accuracy bugs fixed

Benchmark runtimes had become too short, especially since the default
benchmark mask changed from '?b?b?b?b?b?b?b' to '?a?a?a?a?a?a?a?a'. For
very fast hashes like NTLM, benchmarks often stopped immediately when
base words needed to be regenerated, producing highly inaccurate
results.

This issue also misled users tuning '-n' values, as manually
oversubscribing kernels could mask the problem, creating the impression
that increasing '-n' had a larger impact on performance than it truly
does. While '-n' still has an effect, it’s not as significant. With this
fix, users achieve the same speed without needing to tune '-n' manually.

The bug was fixed by enforcing a minimum benchmark runtime of 4 seconds,
regardless of kernel runtime or kernel type. This ensures more stable
and realistic benchmark results, but typically increasing the benchmark
duration by up to 4 seconds.

- Kernel-Threads set to 32 and plugin configuration cleanup

Some plugin configurations existed solely to work around the old
benchmarking bug and can now be removed. For example,
'OPTS_TYPE_MAXIMUM_THREADS' is no longer required and has been removed
from all plugins, although the parameter itself remains to avoid
breaking custom plugins.

Because increasing threads beyond 32 no longer offers meaningful
performance gains, the default is now capped at 32 (unless overridden
with '-T'). This simplifies GPU memory management. Currently, work-item
counts are indirectly limited by buffer sizes (e.g., 'pws_buf[]'), which
must not exceed 4 GiB (a hard-coded limit). This buffer size depends on
the product of 'kernel-accel', 'kernel-threads', and the device’s
compute units. By reducing the default threads from 1024 to 32, there is
now more space available for base words.
2025-06-22 20:17:52 +02:00
Jens Steube
6aeb188b48 - Handle case where system does not offer any reliable method to query actual free memory
- Change package script source folder from $HOME/hashcat to .
- Revisited Apple OpenCL 2GiB Bug (still present)
2025-06-10 12:54:15 +02:00
Jens Steube
c87a87f992 Improvements to SCRYPT autotuning strategy
General:

The logic for calculating the SCRYPT workload has been moved
from module_extra_buffer_size() to module_extra_tuningdb_block().
Previously, this function just returned values from a static
tuning file. Now, it actually computes tuning values on the fly
based on the device's resources and SCRYPT parameters. This
was always possible, it just wasn't used that way until now.

After running the calculation, the calculated kernel_accel value
is injected into the tuning database as if it had come from a
file. The tmto value is stored internally.

Users can still override kernel-threads, kernel-accel, and
scrypt-tmto via the command line or via tuningdb file.

module_extra_tuningdb_block():

This is now where kernel_accel and tmto are automatically
calculated.

The logic for accel and tmto is now separated and more
flexible. Whether the user is using defaults, tuningdb entries, or
manual command line overrides, the code logic will try to make
smart choices based on what's actually available on the device.

First, it tries to find a kernel_accel value that fits into
available memory. It starts with a base value and simulates
tmto=1 or 2 (which is typical good on GPU).

It also leaves room for other buffers (like pws[], tmps[], etc.).
If the result is close to the actual processor count,
it gets clamped.

This value is then added to the tuning database, so hashcat can pick
it up during startup.

Once that's set, it derives tmto using available memory, thread
count, and the actual SCRYPT parameters.

module_extra_buffer_size():

This function now just returns the size of the SCRYPT B[] buffer,
based on the tmto that was already calculated.

kernel_threads:

Defaults are now set to 32 threads in most cases. On AMD GPUs,
64 threads might give a slight performance bump, but 32 is more
consistent and reliable.

For very memory-heavy algorithms (like Ethereum Wallet), it
scales down the thread count.

Here's a rough reference for other SCRYPT-based modes:

- 64 MiB: 16 threads
- 256 MiB: 4 threads

Tuning files:

All built-in tuningdb entries have been removed, because they
shouldn’t be needed anymore. But you can still add custom entries
if needed. There’s even a commented-out example in the tuningdb
file for mode 22700.

Free memory handling:

Getting the actual amount of free GPU memory is critical for
this to work right. Unfortunately, none of the common GPGPU APIs
give reliable numbers. We now query low-level interfaces like
SYSFS (AMD) and NVML (NVIDIA). Support for those APIs is in
place already, except for ADL, which still needs to be added.

Because of this, hwmon support (which handles those low-level
queries) can no longer be disabled.
2025-06-09 11:02:34 +02:00
Jens Steube
d60658102b Added option --backend-devices-keepfree to configure X percentage of device memory available to keep free 2025-06-04 10:13:29 +02:00
Chick3nman
310e9ee79a Add --total-candidates flag and functionality 2025-05-30 14:13:43 -05:00
Jens Steube
ceb5ff5641 The Assimilation Bridge (Framework) 2025-05-29 15:38:13 +02:00
Gabriele Gristina
55f53ba076 assigned -H to --hash-info 2025-05-11 17:16:03 +02:00
Gabriele Gristina
120e758be9 Added options --benchmark-min and --benchmark-max to set a hash-mode range to be used during the benchmark 2025-05-07 18:46:51 +02:00
Gabriele Gristina
b67638ab36 do not allow --stdout and --slow-candidates 2024-10-26 15:11:45 +02:00
Gabriele Gristina
e3c097c88b do not allow --show and --restore 2024-10-26 14:51:11 +02:00
Gabriele Gristina
7398b03be3 User Options: limit --bitmap-max value to 31 2024-10-24 20:15:08 +02:00
jsteube
252e7614da Add a warning about delayed output in case --dynamic-x is used in combination with --show 2023-11-14 07:05:20 +00:00
jsteube
b66527f0d2 Prepare commandline parameter for upcoming partial support for $dynamic_X$ 2023-11-01 16:12:44 +00:00
jsteube
b1b349e8c9 Prepare commandline parameter for upcoming partial support for $dynamic_X$ 2023-10-31 10:38:10 +00:00
jsteube
adbcef6909 Refactor optimized_kernel_enable variable to just optimized_kernel, same idea as outfile_autohex variable 2023-10-30 15:09:36 +00:00
jsteube
e55b331058 Refactor potfile_disable variable to just putfile, same idea as outfile_autohex variable 2023-10-21 16:42:29 +00:00
jsteube
b597a96328 Refactor restore_disable variable to restore_enable, try to make variable names always positive for easier handling 2023-10-20 12:16:18 +00:00
jsteube
ff94f4c9d0 Refactor self_test_disable variable to just self_test, same idea as outfile_autohex variable 2023-10-19 06:08:24 +00:00
jsteube
7b52dad8c9 Refactor multiply_accel_disable variable to just multiply_accel, same idea as outfile_autohex variable 2023-10-18 12:41:09 +00:00
jsteube
bf04a158aa Refactor markov_disable variable to just markov, same idea as outfile_autohex variable 2023-10-17 12:17:05 +00:00
jsteube
e498138bb6 Refactor logfile_disable variable to just logfile, same idea as outfile_autohex variable 2023-10-16 13:18:45 +00:00
jsteube
98ee1bd396 Refactor hwmon_disable variable to just hwmon, same idea as outfile_autohex variable 2023-10-15 18:40:56 +00:00
jsteube
1255afb55c Refactor deprecated_check_disable variable to just deprecated_check, same idea as outfile_autohex variable 2023-10-13 12:17:44 +00:00
jsteube
652b66e642 Refactor advise_disable variable to just advise, same idea as outfile_autohex variable 2023-10-12 13:03:45 +00:00
jsteube
4dceea914f Refactor wordlist_autohex_disable variable to wordlist_autohex, same idea as outfile_autohex variable 2023-10-10 21:03:07 +00:00
PenguinKeeper7
a033180aa1
Update user_options.c 2023-10-08 02:59:01 +01:00
jsteube
e6715fbd89 Prepare options and usage for --outfile-json 2023-10-06 08:21:07 +00:00
PenguinKeeper7
1bae3383dc Fix -o warning when already used 2023-09-18 16:16:47 +01:00
PenguinKeeper7
2954b62a6a Use chgd variable to decide dictstat building
Use rule_buf_l_chgd and rule_buf_r_chgd instead of checking raw values for futureproofing / code cleanliness
2023-09-04 23:09:07 +01:00
PenguinKeeper7
9d9815d166 Prevent file-unsafe characters in --session 2023-08-17 13:51:16 +01:00
Gabriele Gristina
aa4be217fd
Merge branch 'master' into help2int 2023-05-05 15:41:37 +02:00
Gabriele Gristina
36606addac Help: show supported hash-modes only with -hh 2023-05-01 17:38:42 +02:00
Gabriele Gristina
2fe2d299bc update changes.txt + cleanup 2023-05-01 03:44:39 +02:00
Gabriele Gristina
e6d1a4c8a2 Added --metal-compiler-runtime option 2023-05-01 03:33:35 +02:00
jsteube
6785a32e7a 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 2023-04-16 12:04:34 +00:00
philsmd
cb827fcd32
fix trailing spaces 2023-04-11 15:52:34 +02:00
Jens Steube
a1db6d4d63
Merge pull request #3655 from Chick3nman/show-username
Add error message when mixing --show and --username
2023-03-26 23:40:41 +02:00
Chick3nman
10000b324f Move message to log level error to avoid poluting output when sent to a file. 2023-03-23 20:00:42 -05:00
Chick3nman
a4555fdcb9 Fix typo 2 2023-03-23 19:38:17 -05:00
Chick3nman
9c58b47daf Fix typo 2023-03-23 19:37:13 -05:00