Compilar John The Ripper con soporte multiCPU en MacOS Sonoma

Si instalas John The Ripper en MacOS usando brew, por defecto viene limitado a la version single core. Esto puede no importar en la mayoría de casos, pero cuando usas listas grandes, conviene poder usar toda la potencia de cómputo disponible.

Para poder disponer de un John The Ripper con soporte multiprocesador, debemos compilarlo manualmente, y para esto hacen falta varios pasos.

  • Descargar los sources de JtR de https://github.com/openwall/john
  • Instalar openssl con brew install openssl
  • exportamos las siguientes dos variables de entorno:
  • LDFLAGS=-L/opt/homebrew/opt/llvm/lib/ -L/opt/homebrew/lib
  • CPPFLAGS=-I/opt/homebrew/opt/openssl/include/openssl
  • Hacemos el ./configure e ignoramos la indicación de que no está soportado OpenMP
  • Editamos el Makefile y cambiamos las primeras lineas para que queden asi:
CC = /opt/homebrew/opt/llvm/bin/clang -Xpreprocessor -fopenmp -lomp -I/opt/homebrew/include/ -L/opt/homebrew/lib/
PTHREAD_CC = /opt/homebrew/opt/llvm/bin/clang -Xpreprocessor -fopenmp -lomp -I/opt/homebrew/include/ -L/opt/homebrew/lib/
ifdef PTHREAD_CC
CC = /opt/homebrew/opt/llvm/bin/clang -Xpreprocessor -fopenmp -lomp -I/opt/homebrew/include/ -L/opt/homebrew/lib/
endif
AR = /usr/bin/ar
AS = /opt/homebrew/opt/llvm/bin/clang -Xpreprocessor -fopenmp -lomp -I/opt/homebrew/include/ -L/opt/homebrew/lib/
LD = /opt/homebrew/opt/llvm/bin/clang -Xpreprocessor -fopenmp -lomp -I/opt/homebrew/include/ -L/opt/homebrew/lib/
CPP = /opt/homebrew/opt/llvm/bin/clang -Xpreprocessor -fopenmp -lomp -I/opt/homebrew/include/ -L/opt/homebrew/lib/
CP = cp
LN = ln -s
MV = mv -f
RM = rm -f
  • Compilamos con make -j10

John The Ripper Multicore Sonoma + OpenMP support

javi@MBP-Javi /tmp/john/src bleeding-jumbo > ../run/john --test
Will run 10 OpenMP threads
Benchmarking: descrypt, traditional crypt(3) [DES 128/128 ASIMD]… (10xOMP) DONE
Many salts: 44728K c/s real, 7639K c/s virtual
Only one salt: 36003K c/s real, 7129K c/s virtual
Benchmarking: bsdicrypt, BSDI crypt(3) ("_J9..", 725 iterations) [DES 128/128 ASIMD]… (10xOMP) DONE
Speed for cost 1 (iteration count) of 725
Many salts: 1625K c/s real, 261534 c/s virtual
Only one salt: 1571K c/s real, 258952 c/s virtual
Benchmarking: md5crypt, crypt(3) $1$ (and variants) [MD5 128/128 ASIMD 4x2]… (10xOMP) DONE
Many salts: 221134 c/s real, 31680 c/s virtual
Only one salt: 219520 c/s real, 31722 c/s virtual
Benchmarking: md5crypt-long, crypt(3) $1$ (and variants) [MD5 32/64]… (10xOMP) DONE
Raw: 77649 c/s real, 8719 c/s virtual
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]… (10xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 6149 c/s real, 887 c/s virtual

John The Ripper single core MacOS M1 Pro

javi@MBP-Javi  > john --test=2 
Benchmarking: descrypt, traditional crypt(3) [DES 128/128 ASIMD]… DONE
Many salts: 8866K c/s real, 9187K c/s virtual
Only one salt: 8414K c/s real, 8763K c/s virtual
Benchmarking: bsdicrypt, BSDI crypt(3) ("_J9..", 725 iterations) [DES 128/128 ASIMD]… DONE
Speed for cost 1 (iteration count) of 725
Many salts: 293760 c/s real, 306000 c/s virtual
Only one salt: 290197 c/s real, 303800 c/s virtual
Benchmarking: md5crypt, crypt(3) $1$ (and variants) [MD5 128/128 ASIMD 4x2]… DONE
Many salts: 15148 c/s real, 15697 c/s virtual
Only one salt: 15396 c/s real, 15872 c/s virtual
Benchmarking: md5crypt-long, crypt(3) $1$ (and variants) [MD5 32/64]… DONE
Raw: 9293 c/s real, 9628 c/s virtual
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]… DONE
Speed for cost 1 (iteration count) of 32
Raw: 848 c/s real, 878 c/s virtual