hashcat
hashcat copied to clipboard
Managing to solve the bug that did not work with homebrew on macbook m1 and m2
Describe the bug For those who have macbook m1 knows that there is this problem: * Device #2: Kernel /opt/homebrew/Cellar/hashcat/6.2.6_1/share/hashcat/OpenCL/shared.cl build failed. or clCreateProgramWithBinary(): CL_INVALID_VALUE
I had already solved problems like this using a trick I discovered a while ago, you need to create a nickname for a homebrew that is Intel and not Silicon, so it stays in /usr/local/bin/brew. But let's go step by step.
first, install rosetta:
softwareupdate --install-rosetta
Then he got this command to run ZSH with Intel:
arch -x86_64 zsh
Now install brew to x86_64:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
If you prefer like me, create an alias to make it easier to use:
alias ibrew='arch -x86_64 /usr/local/bin/brew'
Now is to install Hashcat:
ibrew install hashcat
it will stay installed here:
/usr/local/Cellar/hashcat/6.2.6_1/bin/hashcat
I create an alias also for this one:
alias ihashcat='/usr/local/Cellar/hashcat/6.2.6_1/bin/hashcat'
test:
❯ ihashcat -II ─╯ hashcat (v6.2.6) starting in backend information mode
System Info:
OS.Name......: Darwin OS.Release...: 22.5.0 HW.Model.....: MacBookAir10,1 HW.Platform..: x86_64
Environment Info:
Cur.Work.Dir.: /Users/deloam Install.Dir..: /usr/local/Cellar/hashcat/6.2.6_1/bin Profile.Dir..: /usr/local/Cellar/hashcat/6.2.6_1/share/hashcat Cache.Dir....: /Users/deloam/.cache/hashcat Shared.Dir...: /usr/local/Cellar/hashcat/6.2.6_1/share/hashcat CL.Inc.Path..: /usr/local/Cellar/hashcat/6.2.6_1/share/hashcat/OpenCL
Metal Info:
Metal.Version.: 306.7.4
Backend Device ID #1 Type...........: GPU Vendor.ID......: 2 Vendor.........: Apple Name...........: Apple M1 Processor(s)...: 7 Clock..........: N/A Memory.Total...: 5461 MB (limited to 2048 MB allocatable in one block) Memory.Free....: 2688 MB Local.Memory...: 32 KB Phys.Location..: built-in Feature.Set....: macOS GPU Family 2 v1 Registry.ID....: 1579 Max.TX.Rate....: N/A GPU.Properties.: headless 0, low-power 0, removable 0
OpenCL Info:
OpenCL Platform ID #1 Vendor..: Apple Name....: Apple Version.: OpenCL 1.2 (Apr 15 2023 03:24:15)
Backend Device ID #2 Type...........: CPU Vendor.ID......: 8 Vendor.........: Intel Name...........: Apple M1 Version........: OpenCL 1.2 Processor(s)...: 8 Clock..........: 2400 Memory.Total...: 8192 MB (limited to 1024 MB allocatable in one block) Memory.Free....: 4064 MB Local.Memory...: 32 KB OpenCL.Version.: OpenCL C 1.2 Driver.Version.: 1.1
Backend Device ID #3 Type...........: GPU Vendor.ID......: 2 Vendor.........: Apple Name...........: Apple M1 Version........: OpenCL 1.2 Processor(s)...: 8 Clock..........: 1000 Memory.Total...: 5461 MB (limited to 512 MB allocatable in one block) Memory.Free....: 2688 MB Local.Memory...: 32 KB OpenCL.Version.: OpenCL C 1.2 Driver.Version.: 1.2 1.0
❯ ihashcat -b ─╯ hashcat (v6.2.6) starting in benchmark mode
Benchmarking uses hand-optimized kernel code by default. You can use it in your cracking session by setting the -O option. Note: Using optimized kernel code limits the maximum supported password length. To disable the optimized kernel code in benchmark mode, use the -w option.
METAL API (Metal 306.7.4)
- Device #1: Apple M1, skipped
OpenCL API (OpenCL 1.2 (Apr 15 2023 03:24:15)) - Platform #1 [Apple]
- Device #2: Apple M1, CPU, 4064/8192 MB (1024 MB allocatable), 8MCU
- Device #3: Apple M1, skipped
Benchmark relevant options:
- --optimized-kernel-enable
- Hash-Mode 0 (MD5)
Speed.#2.........: 176.2 MH/s (23.37ms) @ Accel:512 Loops:1024 Thr:1 Vec:4
- Hash-Mode 100 (SHA1)
Speed.#2.........: 140.9 MH/s (29.69ms) @ Accel:512 Loops:1024 Thr:1 Vec:4
- Hash-Mode 1400 (SHA2-256)
Speed.#2.........: 60925.7 kH/s (68.74ms) @ Accel:512 Loops:1024 Thr:1 Vec:4
- Hash-Mode 1700 (SHA2-512)
Speed.#2.........: 22012.5 kH/s (95.17ms) @ Accel:256 Loops:1024 Thr:1 Vec:2
- Hash-Mode 22000 (WPA-PBKDF2-PMKID+EAPOL) [Iterations: 4095]
Speed.#2.........: 6765 H/s (75.46ms) @ Accel:256 Loops:1024 Thr:1 Vec:4
- Hash-Mode 1000 (NTLM)
Speed.#2.........: 388.7 MH/s (10.71ms) @ Accel:512 Loops:1024 Thr:1 Vec:4
- Hash-Mode 3000 (LM)
- Device #2: Skipping (hash-mode 3000) This is due to a known OpenCL runtime and/or device driver issue (not a hashcat issue) You can use --force to override, but do not report related errors.
- Hash-Mode 5500 (NetNTLMv1 / NetNTLMv1+ESS)
Speed.#2.........: 181.6 MH/s (22.99ms) @ Accel:512 Loops:1024 Thr:1 Vec:4
- Hash-Mode 5600 (NetNTLMv2)
Speed.#2.........: 13797.7 kH/s (75.90ms) @ Accel:128 Loops:1024 Thr:1 Vec:4
- Hash-Mode 1500 (descrypt, DES (Unix), Traditional DES)
- Device #2: Skipping (hash-mode 1500) This is due to a known OpenCL runtime and/or device driver issue (not a hashcat issue) You can use --force to override, but do not report related errors.
- Hash-Mode 500 (md5crypt, MD5 (Unix), Cisco-IOS $1$ (MD5)) [Iterations: 1000]
Speed.#2.........: 41684 H/s (48.70ms) @ Accel:512 Loops:500 Thr:1 Vec:4
- Hash-Mode 3200 (bcrypt $2*$, Blowfish (Unix)) [Iterations: 32]
Speed.#2.........: 2833 H/s (21.00ms) @ Accel:8 Loops:32 Thr:1 Vec:1
- Hash-Mode 1800 (sha512crypt $6$, SHA512 (Unix)) [Iterations: 5000]
Speed.#2.........: 2793 H/s (36.42ms) @ Accel:512 Loops:1024 Thr:1 Vec:2
- Hash-Mode 7500 (Kerberos 5, etype 23, AS-REQ Pre-Auth)
Speed.#2.........: 3854.1 kH/s (67.93ms) @ Accel:64 Loops:512 Thr:1 Vec:4
- Hash-Mode 13100 (Kerberos 5, etype 23, TGS-REP)
Speed.#2.........: 3663.7 kH/s (71.44ms) @ Accel:128 Loops:256 Thr:1 Vec:4
- Hash-Mode 15300 (DPAPI masterkey file v1 (context 1 and 2)) [Iterations: 23999]
Speed.#2.........: 1200 H/s (70.89ms) @ Accel:256 Loops:1024 Thr:1 Vec:4
- Hash-Mode 15900 (DPAPI masterkey file v2 (context 1 and 2)) [Iterations: 12899]
Speed.#2.........: 783 H/s (50.21ms) @ Accel:128 Loops:512 Thr:1 Vec:2
- Hash-Mode 7100 (macOS v10.8+ (PBKDF2-SHA512)) [Iterations: 1023]
Speed.#2.........: 9800 H/s (51.58ms) @ Accel:64 Loops:1023 Thr:1 Vec:2
- Hash-Mode 11600 (7-Zip) [Iterations: 16384]
Speed.#2.........: 2761 H/s (92.43ms) @ Accel:128 Loops:4096 Thr:1 Vec:4
- Hash-Mode 12500 (RAR3-hp) [Iterations: 262144]
Speed.#2.........: 414 H/s (77.12ms) @ Accel:64 Loops:16384 Thr:1 Vec:4
- Hash-Mode 13000 (RAR5) [Iterations: 32799]
^C
Hello, I have encountered a problem
danilefimov@Unknown / % hashcat -m 0 -D 2 -b
hashcat (v6.2.6) starting in benchmark mode
Benchmarking uses hand-optimized kernel code by default. You can use it in your cracking session by setting the -O option. Note: Using optimized kernel code limits the maximum supported password length. To disable the optimized kernel code in benchmark mode, use the -w option.
- Device #2: Apple's OpenCL drivers (GPU) are known to be unreliable. You have been warned.
METAL API (Metal 306.7.5)
- Device #1: Apple M1, 2688/5461 MB, 7MCU
OpenCL API (OpenCL 1.2 (Jun 23 2023 20:24:12)) - Platform #1 [Apple]
- Device #2: Apple M1, GPU, 2688/5461 MB (512 MB allocatable), 8MCU
Benchmark relevant options:
- --opencl-device-types=2
- --optimized-kernel-enable
- Hash-Mode 0 (MD5)
/Users/danilefimov/.cache/hashcat/kernels/shared.833f28d0.kernel: No such file or directory
- Device #2: Kernel /opt/homebrew/Cellar/hashcat/6.2.6_1/share/hashcat/OpenCL/shared.cl build failed.
Started: Sun Dec 3 16:15:41 2023 Stopped: Sun Dec 3 16:15:43 2023
I really need your help, i have a mac m1, i understand almost nothing about hashcat, i have gone through all the forums and articles and could not find a solution to the problem, i really want to learn how to use hashcat, but it is very difficult for me. Could you please help me to learn how to use hashcat, and also I have a question, those lines you wrote in the article, where do you put them?
Hi all,
look here for the workaround: https://github.com/hashcat/hashcat/issues/3082#issuecomment-1002238454
Let me know, thanks