Skip to content

Instantly share code, notes, and snippets.

@reggi
Last active March 30, 2022 08:39
Show Gist options
  • Save reggi/2faadedd925789a3d25196f2a036ecc6 to your computer and use it in GitHub Desktop.
Save reggi/2faadedd925789a3d25196f2a036ecc6 to your computer and use it in GitHub Desktop.
Building John The Ripper on OSX.
@brasilikum
Copy link

brew link openssl --force now leads to

Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

@mubix
Copy link

mubix commented Jun 29, 2017

From the Install doc: https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/doc/INSTALL#L154

  1. Install Homebrew:
	http://mxcl.github.io/homebrew/
  2. Install Homebrew's gcc and openssl:
	brew install gcc openssl
  3. Make sure /usr/local/bin precedes /usr/bin in your $PATH
  4. Provide the path to GCC and the OpenSSL libraries to the configure script:
        ./configure CC="gcc-6" CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib"
  5. Clean old files and make:
        make clean && make

@ethicalhack3r
Copy link

Thanks for the info @mubix!

On High Sierra I had to make a couple of changes, as I was getting the following error during compilation:

checking whether the C compiler works... no

So, I didn't install gcc in Homebrew and then left that flag (CC="gcc-6") out of the compile flags, while also adding the --disable-pkg-config option, so it looked like this:

./configure CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" --disable-pkg-config

@rgov
Copy link

rgov commented Mar 9, 2018

You should use $(brew --prefix) when possible instead of hard-coding Homebrew paths.

./configure CPPFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" --disable-pkg-config

@R3dy
Copy link

R3dy commented Mar 20, 2019

Some great comments here, thanks a bunch to @mubix and @rgov

My mileage varied slightly but in the end this is what worked for me on a 2018 Macbook Pro running Mojave. This was after installing gcc and openssl via brew. Notice the CFLAGS instead of CPPFLAGS

./configure CC="gcc-8" CFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" --disable-pkg-config

@alexeynikolayev
Copy link

Getting stuck on catalina :(

checking additional paths for OpenSSL... none
checking openssl/opensslv.h usability... no
checking openssl/opensslv.h presence... yes
configure: WARNING: openssl/opensslv.h: present but cannot be compiled
configure: WARNING: openssl/opensslv.h:     check for missing prerequisite headers?
configure: WARNING: openssl/opensslv.h: see the Autoconf documentation
configure: WARNING: openssl/opensslv.h:     section "Present But Cannot Be Compiled"
configure: WARNING: openssl/opensslv.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------------ ##
configure: WARNING:     ## Report this to john-users mailing list at openwall.com ##
configure: WARNING:     ## ------------------------------------------------------ ##
checking for openssl/opensslv.h... no
configure: error: in `/Users/user/temp/jumbo/src':
configure: error: JtR requires OpenSSL headers being installed
See `config.log' for more details

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