Skip to content

Instantly share code, notes, and snippets.

@securisec
Last active January 10, 2024 04:38
Show Gist options
  • Save securisec/c332939963438b41b392669b8901232b to your computer and use it in GitHub Desktop.
Save securisec/c332939963438b41b392669b8901232b to your computer and use it in GitHub Desktop.

Build john for ARM OSX

Recently during a CTF, I was working with a SSH private key hash that I could not crack. Afterwards I found out that the john-jumbo installed via brew is quite outdated and that includes the helper scripts where the brew version of ssh2john.py script generates a hash that is not valid.

The following steps outlines how to compile john from github on a M series mac/osx. Tested on a M3, but should also work on M1 and M2 also.

Dependencies

brew install [email protected] llvm

Adjust based on your version of openssl. Version 3 was not tested.

git clone https://github.com/openwall/john
cd john/src/
export LDFLAGS=-L/opt/homebrew/Cellar/[email protected]/1.1.1w/lib
export CPPFLAGS=-I/opt/homebrew/Cellar/[email protected]/1.1.1w/include
./configure

openmp support (optional YMMV)

As per https://medium.com/@seitzmanuel/how-to-compile-john-the-ripper-on-mac-osx-with-openmp-support-multicore-big-sur-a60cad850b7d

Change all instance of gcc to /opt/homebrew/opt/llvm/bin/clang -fopenmp -I/opt/homebrew/opt/llvm/include -L/opt/homebrew/opt/llvm/lib inside the main Makefile

Finally:

make clean && make -sj8

Built files are in the run directory. So ../run/john

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment