知識は未だ霧の中

スパコン眼鏡NET。HPCのことはあまり書かない。

High SierraでJohn The Ripperをコンパイルする方法。

OS X (High Sierra) 上でJtRを使おうとして色々と罠があったのでメモ。

GCCとOpenSSLのインストール

まず、GCCとOpenSSLをインストールします。その後、OpenSSLにパスを通します。

$ brew update && brew upgrade
$ brew install gcc openssl


続いてOpenSSLにパスを通します。

$ brew list openssl
/usr/local/Cellar/openssl/1.0.2n/.bottle/etc/ (8 files)
/usr/local/Cellar/openssl/1.0.2n/bin/c_rehash
/usr/local/Cellar/openssl/1.0.2n/bin/openssl
/usr/local/Cellar/openssl/1.0.2n/include/openssl/ (75 files)
/usr/local/Cellar/openssl/1.0.2n/lib/libcrypto.1.0.0.dylib
/usr/local/Cellar/openssl/1.0.2n/lib/libssl.1.0.0.dylib
/usr/local/Cellar/openssl/1.0.2n/lib/engines/ (12 files)
/usr/local/Cellar/openssl/1.0.2n/lib/pkgconfig/ (3 files)
/usr/local/Cellar/openssl/1.0.2n/lib/ (4 other files)
/usr/local/Cellar/openssl/1.0.2n/share/man/ (1680 files)

$ export PATH=/usr/local/Cellar/openssl/1.0.2k/bin:$PATH

$ which openssl
/usr/local/Cellar/openssl/1.0.2k/bin/openssl

JohnTheRipperのコンパイル

公式のリポジトリからソースコードを取得し、コンパイルします。

$ git clone --depth 1 git@github.com:magnumripper/JohnTheRipper.git
$ cd JohnTheRipper/src
$ ./configure CPPFLAGS="-I/usr/local/Cellar/openssl/1.0.2k/include" CFLAGS="-I/usr/local/Cellar/openssl/1.0.2k/include" LDFLAGS="-L/usr/local/Cellar/openssl/1.0.2k/lib" --disable-pkg-config CC="gcc-7"  
$ make -s clean && make -sj4


最後に操作確認をします。

$ cd ../run
$ ./john --test