2015-10-13 04:33:14 +02:00
|
|
|
{ stdenv, fetchurl, openssl, nss, nspr, kerberos, gmp, zlib, libpcap, re2
|
2016-05-21 22:05:41 +02:00
|
|
|
, writeText, gcc
|
2015-10-13 04:33:14 +02:00
|
|
|
}:
|
2014-09-04 01:30:04 +02:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-10-12 20:29:52 +02:00
|
|
|
name = "john-${version}";
|
|
|
|
version = "1.8.0-jumbo-1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.openwall.com/john/j/${name}.tar.xz";
|
|
|
|
sha256 = "08q92sfdvkz47rx6qjn7qv57cmlpy7i7rgddapq5384mb413vjds";
|
|
|
|
};
|
|
|
|
|
2016-02-08 01:39:17 +01:00
|
|
|
patches = [ ./gcc5.patch ];
|
|
|
|
|
2015-10-13 04:33:14 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -ri -e '
|
|
|
|
s!^(#define\s+CFG_[A-Z]+_NAME\s+).*/!\1"'"$out"'/etc/john/!
|
|
|
|
/^#define\s+JOHN_SYSTEMWIDE/s!/usr!'"$out"'!
|
|
|
|
' src/params.h
|
|
|
|
sed -ri -e '/^\.include/ {
|
|
|
|
s!\$JOHN!'"$out"'/etc/john!
|
|
|
|
s!^(\.include\s*)<([^./]+\.conf)>!\1"'"$out"'/etc/john/\2"!
|
|
|
|
}' run/*.conf
|
|
|
|
'';
|
2015-10-12 20:29:52 +02:00
|
|
|
|
|
|
|
preConfigure = "cd src";
|
2015-10-13 04:02:56 +02:00
|
|
|
configureFlags = [ "--disable-native-macro" ];
|
2015-10-12 20:29:52 +02:00
|
|
|
|
2016-05-21 22:05:41 +02:00
|
|
|
buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc ];
|
2017-03-10 00:48:53 +01:00
|
|
|
|
|
|
|
# gcc -DAC_BUILT -Wall vncpcap2john.o memdbg.o -g -lpcap -fopenmp -o ../run/vncpcap2john
|
|
|
|
# gcc: error: memdbg.o: No such file or directory
|
|
|
|
enableParallelBuilding = false;
|
2015-10-13 04:33:14 +02:00
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-DJOHN_SYSTEMWIDE=1" ];
|
|
|
|
|
2014-09-04 01:30:04 +02:00
|
|
|
installPhase = ''
|
2015-10-13 04:33:14 +02:00
|
|
|
mkdir -p "$out/etc/john" "$out/share/john" "$out/share/doc/john"
|
|
|
|
find ../run -mindepth 1 -maxdepth 1 -type f -executable \
|
|
|
|
-exec "${stdenv.shell}" "${writeText "john-binary-install.sh" ''
|
|
|
|
filename="$(basename "$1")"
|
|
|
|
install -vD "$1" "$out/bin/''${filename%.*}"
|
|
|
|
''}" {} \;
|
|
|
|
cp -vt "$out/etc/john" ../run/*.conf
|
|
|
|
cp -vt "$out/share/john" ../run/*.chr ../run/password.lst
|
|
|
|
cp -vrt "$out/share/doc/john" ../doc/*
|
2014-09-04 01:30:04 +02:00
|
|
|
'';
|
2015-10-12 20:29:52 +02:00
|
|
|
|
2014-09-04 01:30:04 +02:00
|
|
|
meta = {
|
|
|
|
description = "John the Ripper password cracker";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
homepage = https://github.com/magnumripper/JohnTheRipper/;
|
2015-10-12 20:29:52 +02:00
|
|
|
maintainers = with maintainers; [ offline ];
|
2015-11-17 21:29:29 +01:00
|
|
|
platforms = platforms.unix;
|
2014-09-04 01:30:04 +02:00
|
|
|
};
|
|
|
|
}
|