How to install HashCat in MacOS

How to install HashCat in MacOS

Well well well, it's time to put that shiny M2 Pro chip to the test right?

It seems to be as simple as:

brew install hashcat

Which will have an output similar to this:

terminator@skynet ~ % brew install hashcat
==> Homebrew collects anonymous analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
bfs                          mvfst                        python-cryptography
killport                     plog                         terragrunt-atlantis-config
llm                          prettierd
==> New Casks
4k-video-downloaderplus      lm-studio                    sfm
herd                         replay
keyclu                       ripx

You have 1 outdated formula installed.

==> Fetching dependencies for hashcat: minizip and xxhash
==> Fetching minizip
==> Downloading https://ghcr.io/v2/homebrew/core/minizip/manifests/1.2.13
############################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/minizip/blobs/sha256:f04d79cbe3e1d6c
############################################################################## 100.0%
==> Fetching xxhash
==> Downloading https://ghcr.io/v2/homebrew/core/xxhash/manifests/0.8.2
############################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/xxhash/blobs/sha256:13882b17bbb0bcd1
############################################################################## 100.0%
==> Fetching hashcat
==> Downloading https://ghcr.io/v2/homebrew/core/hashcat/manifests/6.2.6_1
############################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/hashcat/blobs/sha256:c9bda2074060ddc
############################################################################## 100.0%
==> Installing dependencies for hashcat: minizip and xxhash
==> Installing hashcat dependency: minizip
==> Pouring minizip--1.2.13.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/minizip/1.2.13: 14 files, 382.8KB
==> Installing hashcat dependency: xxhash
==> Pouring xxhash--0.8.2.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/xxhash/0.8.2: 21 files, 462.6KB
==> Installing hashcat
==> Pouring hashcat--6.2.6_1.arm64_monterey.bottle.tar.gz
🍺  /opt/homebrew/Cellar/hashcat/6.2.6_1: 2,045 files, 130.1MB
==> Running `brew cleanup hashcat`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

Check your version:

terminator@skynet ~ % hashcat --version
v6.2.6

Now the fun part!

Create a file called md5.txt and paste the following content in it.

eb61eead90e3b899c6bcbe27ac581660
fbade9e36a3f36d3d676c1b808451dd7
4d186321c1a7f0f354b297e8914ab240
f688ae26e9cfa3ba6235477831d5122e
c6f00988430dbc8e83a7bc7ab5256346

Now run the following command:

hashcat -m 0 -a 3 -i md5.txt ?a?a?a?a?a -o output.pot

Your output may be similar to this:

hashcat (v6.2.6) starting

* 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 M2 Pro, 10880/21845 MB, 19MCU

OpenCL API (OpenCL 1.2 (Jun 23 2023 20:24:12)) - Platform #1 [Apple]
====================================================================
* Device #2: Apple M2 Pro, skipped

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256

Hashes: 5 digests; 5 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates

Optimizers applied:
* Zero-Byte
* Early-Skip
* Not-Salted
* Not-Iterated
* Single-Salt
* Brute-Force
* Raw-Hash

ATTENTION! Pure (unoptimized) backend kernels selected.
Pure kernels can crack longer passwords, but drastically reduce performance.
If you want to switch to optimized kernels, append -O to your commandline.
See the above message to find out about the exact limits.

Watchdog: Temperature abort trigger set to 100c

Host memory required for this attack: 667 MB

The wordlist or mask that you are using is too small.
This means that hashcat cannot use the full parallel power of your device(s).
Unless you supply more work, your cracking speed will drop.
For tips on supplying more work, see: https://hashcat.net/faq/morework

Approaching final keyspace - workload adjusted.           

                                                          
Session..........: hashcat
Status...........: Exhausted
Hash.Mode........: 0 (MD5)
Hash.Target......: md5.txt
Time.Started.....: Fri Jul 28 23:10:59 2023 (1 sec)
Time.Estimated...: Fri Jul 28 23:11:00 2023 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Mask.......: ?a [1]
Guess.Queue......: 1/5 (20.00%)
Speed.#1.........:     9347 H/s (0.18ms) @ Accel:512 Loops:95 Thr:32 Vec:1
Recovered........: 1/5 (20.00%) Digests (total), 1/5 (20.00%) Digests (new)
Progress.........: 95/95 (100.00%)
Rejected.........: 0/95 (0.00%)
Restore.Point....: 1/1 (100.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-95 Iteration:0-95
Candidate.Engine.: Device Generator
Candidates.#1....: s ->  
Hardware.Mon.SMC.: Fan0: 0%, Fan1: 0%
Hardware.Mon.#1..: Util: 92%

The wordlist or mask that you are using is too small.
This means that hashcat cannot use the full parallel power of your device(s).
Unless you supply more work, your cracking speed will drop.
For tips on supplying more work, see: https://hashcat.net/faq/morework

Approaching final keyspace - workload adjusted.           

                                                          
Session..........: hashcat
Status...........: Exhausted
Hash.Mode........: 0 (MD5)
Hash.Target......: md5.txt
Time.Started.....: Fri Jul 28 23:11:00 2023 (0 secs)
Time.Estimated...: Fri Jul 28 23:11:00 2023 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Mask.......: ?a?a [2]
Guess.Queue......: 2/5 (40.00%)
Speed.#1.........:  9631.8 kH/s (0.15ms) @ Accel:512 Loops:95 Thr:32 Vec:1
Recovered........: 1/5 (20.00%) Digests (total), 1/5 (20.00%) Digests (new)
Progress.........: 9025/9025 (100.00%)
Rejected.........: 0/9025 (0.00%)
Restore.Point....: 95/95 (100.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-95 Iteration:0-95
Candidate.Engine.: Device Generator
Candidates.#1....: sa ->   
Hardware.Mon.SMC.: Fan0: 0%, Fan1: 0%
Hardware.Mon.#1..: Util: 93%

The wordlist or mask that you are using is too small.
This means that hashcat cannot use the full parallel power of your device(s).
Unless you supply more work, your cracking speed will drop.
For tips on supplying more work, see: https://hashcat.net/faq/morework

Approaching final keyspace - workload adjusted.           

                                                          
Session..........: hashcat
Status...........: Exhausted
Hash.Mode........: 0 (MD5)
Hash.Target......: md5.txt
Time.Started.....: Fri Jul 28 23:11:00 2023 (0 secs)
Time.Estimated...: Fri Jul 28 23:11:00 2023 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Mask.......: ?a?a?a [3]
Guess.Queue......: 3/5 (60.00%)
Speed.#1.........:   214.0 MH/s (0.16ms) @ Accel:512 Loops:95 Thr:32 Vec:1
Recovered........: 1/5 (20.00%) Digests (total), 1/5 (20.00%) Digests (new)
Progress.........: 857375/857375 (100.00%)
Rejected.........: 0/857375 (0.00%)
Restore.Point....: 9025/9025 (100.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-95 Iteration:0-95
Candidate.Engine.: Device Generator
Candidates.#1....: sd: ->   ~
Hardware.Mon.SMC.: Fan0: 0%, Fan1: 0%
Hardware.Mon.#1..: Util: 95%

Approaching final keyspace - workload adjusted.           

                                                          
Session..........: hashcat
Status...........: Exhausted
Hash.Mode........: 0 (MD5)
Hash.Target......: md5.txt
Time.Started.....: Fri Jul 28 23:11:00 2023 (0 secs)
Time.Estimated...: Fri Jul 28 23:11:00 2023 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Mask.......: ?a?a?a?a [4]
Guess.Queue......: 4/5 (80.00%)
Speed.#1.........:  1632.3 MH/s (3.38ms) @ Accel:512 Loops:95 Thr:32 Vec:1
Recovered........: 4/5 (80.00%) Digests (total), 4/5 (80.00%) Digests (new)
Progress.........: 81450625/81450625 (100.00%)
Rejected.........: 0/81450625 (0.00%)
Restore.Point....: 857375/857375 (100.00%)
Restore.Sub.#1...: Salt:0 Amplifier:0-95 Iteration:0-95
Candidate.Engine.: Device Generator
Candidates.#1....: smB) ->   ~}
Hardware.Mon.SMC.: Fan0: 0%, Fan1: 0%
Hardware.Mon.#1..: Util:100%

                                                          
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 0 (MD5)
Hash.Target......: md5.txt
Time.Started.....: Fri Jul 28 23:11:01 2023 (0 secs)
Time.Estimated...: Fri Jul 28 23:11:01 2023 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Mask.......: ?a?a?a?a?a [5]
Guess.Queue......: 5/5 (100.00%)
Speed.#1.........:  1733.8 MH/s (7.46ms) @ Accel:512 Loops:95 Thr:32 Vec:1
Recovered........: 5/5 (100.00%) Digests (total), 5/5 (100.00%) Digests (new)
Progress.........: 177438720/7737809375 (2.29%)
Rejected.........: 0/177438720 (0.00%)
Restore.Point....: 1556480/81450625 (1.91%)
Restore.Sub.#1...: Salt:0 Amplifier:0-95 Iteration:0-95
Candidate.Engine.: Device Generator
Candidates.#1....: saS\' ->  (`NI
Hardware.Mon.SMC.: Fan0: 0%, Fan1: 0%
Hardware.Mon.#1..: Util: 97%

Started: Fri Jul 28 23:10:52 2023
Stopped: Fri Jul 28 23:11:02 2023

The passwords got cracked recovered in 10 seconds. For other PCs of mine the same exercise took several minutes on a Core i5 6th Gen processor. So I am quite happy with the results.

After the process is done you can run:

cat output.pot

The contents may look similar to this:

eb61eead90e3b899c6bcbe27ac581660:HELLO
fbade9e36a3f36d3d676c1b808451dd7:z
4d186321c1a7f0f354b297e8914ab240:hola
f688ae26e9cfa3ba6235477831d5122e:Hola
c6f00988430dbc8e83a7bc7ab5256346:HOLA

The important part here is that Apple M2 Pro chip should theoretically crack recover passwords faster.

Sources: