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.
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
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