Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong candidates generating for masks with few devices, --stdout and -o (hashcat 6.2.6 only bug in Windows) #3944

Open
PROger4ever opened this issue Feb 6, 2024 · 7 comments
Labels

Comments

@PROger4ever
Copy link

PROger4ever commented Feb 6, 2024

Describe the bug
There're wrong candidates in output with few devices, --stdout and -o options for some masks (hashcat 6.2.6 only bug in Windows).

To Reproduce
Discrete GPU + Integrated Graphics:
hashcat.exe -d 1,3 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" -o "test.txt"
Got result with only a part of candidates range 020000000...029999999 and a lot of wrong candidates like 0, 00, 00188350, a mix of \r, \n and \r\n newline-styles. The result file differs each time you delete the file and run the command again (thread-race while output?).

Expected behavior
The result file, containing candidates 020000000...029999999 like with -d 1:
hashcat.exe -d 1 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" -o "test.txt"

Hardware/Compute device (please complete the following information):

  • Compute device name: 3080 Mobile / 4050 Mobile
  • OpenCL/CUDA driver name: NVIDIA DRIVER
  • OpenCL/CUDA driver version: 546.33
  • OpenCL/CUDA driver source: .exe installer

Hashcat version (please complete the following information):

  • OS: Windows
  • Distribution: 10 / 11
  • Version: 22H2 19045.3996 / 23H2 22631.3007

Diagnostic output compute devices:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 546.33                 Driver Version: 546.33       CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                     TCC/WDDM  | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 3080 ...  WDDM  | 00000000:01:00.0  On |                  N/A |
| N/A   73C    P0             129W / 130W |   1172MiB / 16384MiB |    100%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A     22712      C   ...ashcatGUI\hashcat-6.2.6\hashcat.exe    N/A      |
|    0   N/A  N/A     25092      C   ...ashcatGUI\hashcat-6.2.6\hashcat.exe    N/A      |
+---------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 546.33                 Driver Version: 546.33       CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                     TCC/WDDM  | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4050 ...  WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   84C    P0              69W /  75W |   4910MiB /  6141MiB |    100%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A     12008      C   ...ashcatGUI\hashcat-6.2.6\hashcat.exe    N/A      |
+---------------------------------------------------------------------------------------+
Post clinfo output
hashcat (v6.2.6) starting in backend information mode

CUDA Info:
==========

CUDA.Version.: 12.3

Backend Device ID #1 (Alias: #2)
  Name...........: NVIDIA GeForce RTX 3080 Laptop GPU
  Processor(s)...: 48
  Clock..........: 1545
  Memory.Total...: 16383 MB
  Memory.Free....: 15267 MB
  Local.Memory...: 99 KB
  PCI.Addr.BDFe..: 0000:01:00.0

OpenCL Info:
============

OpenCL Platform ID #1
  Vendor..: NVIDIA Corporation
  Name....: NVIDIA CUDA
  Version.: OpenCL 3.0 CUDA 12.3.107

  Backend Device ID #2 (Alias: #1)
    Type...........: GPU
    Vendor.ID......: 32
    Vendor.........: NVIDIA Corporation
    Name...........: NVIDIA GeForce RTX 3080 Laptop GPU
    Version........: OpenCL 3.0 CUDA
    Processor(s)...: 48
    Clock..........: 1545
    Memory.Total...: 16383 MB (limited to 4095 MB allocatable in one block)
    Memory.Free....: 16256 MB
    Local.Memory...: 48 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 546.33
    PCI.Addr.BDF...: 01:00.0

OpenCL Platform ID #2
  Vendor..: Intel(R) Corporation
  Name....: Intel(R) OpenCL HD Graphics
  Version.: OpenCL 3.0

  Backend Device ID #3
    Type...........: GPU
    Vendor.ID......: 8
    Vendor.........: Intel(R) Corporation
    Name...........: Intel(R) UHD Graphics
    Version........: OpenCL 3.0 NEO
    Processor(s)...: 32
    Clock..........: 1450
    Memory.Total...: 26119 MB (limited to 2047 MB allocatable in one block)
    Memory.Free....: 13024 MB
    Local.Memory...: 64 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 27.20.100.9664
hashcat (v6.2.6) starting in backend information mode

CUDA Info:
==========

CUDA.Version.: 12.3

Backend Device ID #1 (Alias: #2)
  Name...........: NVIDIA GeForce RTX 4050 Laptop GPU
  Processor(s)...: 20
  Clock..........: 2130
  Memory.Total...: 6140 MB
  Memory.Free....: 5090 MB
  Local.Memory...: 99 KB
  PCI.Addr.BDFe..: 0000:01:00.0

OpenCL Info:
============

OpenCL Platform ID #1
  Vendor..: NVIDIA Corporation
  Name....: NVIDIA CUDA
  Version.: OpenCL 3.0 CUDA 12.3.107

  Backend Device ID #2 (Alias: #1)
    Type...........: GPU
    Vendor.ID......: 32
    Vendor.........: NVIDIA Corporation
    Name...........: NVIDIA GeForce RTX 4050 Laptop GPU
    Version........: OpenCL 3.0 CUDA
    Processor(s)...: 20
    Clock..........: 2130
    Memory.Total...: 6140 MB (limited to 1535 MB allocatable in one block)
    Memory.Free....: 6016 MB
    Local.Memory...: 48 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 546.33
    PCI.Addr.BDF...: 01:00.0

OpenCL Platform ID #2
  Vendor..: Intel(R) Corporation
  Name....: Intel(R) OpenCL Graphics
  Version.: OpenCL 3.0

  Backend Device ID #3
    Type...........: GPU
    Vendor.ID......: 8
    Vendor.........: Intel(R) Corporation
    Name...........: Intel(R) Iris(R) Xe Graphics
    Version........: OpenCL 3.0 NEO
    Processor(s)...: 80
    Clock..........: 1300
    Memory.Total...: 26102 MB (limited to 2047 MB allocatable in one block)
    Memory.Free....: 12992 MB
    Local.Memory...: 64 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 31.0.101.4575
On Linux: post lspci output

Additional context
The problem doesn't appear when only one device is used, the mask is shorter, when piping to a file is used instead of -o, --stdout isn't used, older or linux-version of hashcat is used.

@PROger4ever PROger4ever added the bug label Feb 6, 2024
@PROger4ever
Copy link
Author

PROger4ever commented Feb 6, 2024

Can be caused by #3941 ?

@Chick3nman
Copy link
Contributor

It's extremely unlikely that #3941 has anything to do with this. More likely there is an issue with your drivers or iGPU or similar. Why are you selecting the devices at all when running --stdout? There's no need to select a computing device as it will not make it faster. I'd suggest letting hashcat select the default device on it's own and see if that changes the results. That said, if that does break things, we may need to determine why and either fix or limit this behavior.

@Chick3nman
Copy link
Contributor

Could you retest without -o and instead use > to redirect the output? I have some suspicion that this may be related to a bug that was recently worked on.

@PROger4ever
Copy link
Author

PROger4ever commented Feb 6, 2024

More likely there is an issue with your drivers or iGPU or similar.

It's not likely. As I described above, this bug issued on different hardwares.

Why are you selecting the devices at all when running --stdout?

I didn't but hashcat chooses 2 devices (discrete and integrated GPUs) by default issuing the bug. So I described the explicit example.

Could you retest without -o and instead use > to redirect the output? I have some suspicion that this may be related to a bug that was recently worked on.

As I told in the "Additional context" section, piping to a file (>) produces the correct result :) So, maybe this bug should be tested after fixing that recent bug :)

@Chick3nman
Copy link
Contributor

As I told in the "Additional context" section, piping to a file (>) produces the correct result :) So, maybe this bug should be tested after fixing that bug :)

Ahh thank you, I should read more carefully, I missed those notes. I was able to reproduce the issue with the latest master so I don't think this is related to the issue I was guessing initially.

hashcat.exe -d 1 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" > test.txt PASS
hashcat.exe -d 1,3 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" > test.txt PASS - Order is different, all pws are present
hashcat.exe -d 1 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" -o test.txt PASS
hashcat.exe -d 3 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" -o test.txt PASS
hashcat.exe -d 1,3 -a 3 --markov-disable --stdout "02?d?d?d?d?d?d?d" -o test.txt FAIL

This is a bit strange, perhaps a race condition or other contention on accessing the file?

@PROger4ever
Copy link
Author

PROger4ever commented Feb 6, 2024

This is a bit strange, perhaps a race condition or other contention on accessing the file?

Yeah, seems to be. Furthermore, 6.2.6 and Windows only (not sure)

@Chick3nman
Copy link
Contributor

I just did some version testing, it appears that the minor releases 6.2.5 and 6.2.4 both also contain this bug and produce bad outputs in that specific condition. However 6.2.3 and further back to 6.1.1 at least do not appear to contain this issue and exhibit expected behavior. This will likely have been introduced some time after 6.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants