2017-12-27 15:15:33 +00:00
|
|
|
{ stdenv, lib, fetchurl, zlib, openssl, ncurses, libidn, pcre, libssh, mysql, postgresql
|
2016-08-11 11:49:10 +01:00
|
|
|
, withGUI ? false, makeWrapper, pkgconfig, gtk2 }:
|
2014-09-21 00:50:43 +01:00
|
|
|
|
2016-08-11 11:49:10 +01:00
|
|
|
let
|
|
|
|
makeDirs = output: subDir: pkgs: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) pkgs);
|
2014-09-21 00:50:43 +01:00
|
|
|
|
2016-08-11 11:49:10 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2014-10-13 14:58:07 +01:00
|
|
|
name = "thc-hydra-${version}";
|
2017-06-20 02:18:19 +01:00
|
|
|
version = "8.5";
|
2014-09-21 00:50:43 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-10-13 14:58:07 +01:00
|
|
|
url = "http://www.thc.org/releases/hydra-${version}.tar.gz";
|
2017-06-20 02:18:19 +01:00
|
|
|
sha256 = "0vfx6xwmw0r7nd0s232y7rckcj58fc1iqjgp4s56rakpz22b4yjm";
|
2014-09-21 00:50:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
2016-08-11 11:49:10 +01:00
|
|
|
substituteInPlace configure \
|
|
|
|
--replace "\$LIBDIRS" "${makeDirs "lib" "lib" buildInputs}" \
|
|
|
|
--replace "\$INCDIRS" "${makeDirs "dev" "include" buildInputs}" \
|
2016-08-11 18:16:45 +01:00
|
|
|
--replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
|
2016-08-11 11:49:10 +01:00
|
|
|
--replace "libcurses.so" "libncurses.so" \
|
|
|
|
--replace "-lcurses" "-lncurses"
|
2014-09-21 00:50:43 +01:00
|
|
|
'';
|
|
|
|
|
2016-08-11 11:49:10 +01:00
|
|
|
nativeBuildInputs = lib.optionals withGUI [ pkgconfig makeWrapper ];
|
2017-12-27 15:15:33 +00:00
|
|
|
buildInputs = [ zlib openssl ncurses libidn pcre libssh mysql.connector-c postgresql ]
|
2016-08-11 11:49:10 +01:00
|
|
|
++ lib.optional withGUI gtk2;
|
2014-09-21 00:50:43 +01:00
|
|
|
|
2016-08-11 11:49:10 +01:00
|
|
|
postInstall = lib.optionalString withGUI ''
|
|
|
|
wrapProgram $out/bin/xhydra \
|
|
|
|
--add-flags --hydra-path --add-flags "$out/bin/hydra"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2014-09-21 00:50:43 +01:00
|
|
|
description = "A very fast network logon cracker which support many different services";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
homepage = https://www.thc.org/thc-hydra/;
|
|
|
|
maintainers = with maintainers; [offline];
|
2016-08-11 11:49:10 +01:00
|
|
|
platforms = platforms.linux;
|
2014-09-21 00:50:43 +01:00
|
|
|
};
|
|
|
|
}
|