2019-09-26 00:52:30 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql
|
2021-01-17 04:51:22 +01:00
|
|
|
, withGUI ? false, makeWrapper, pkg-config, gtk2 }:
|
2014-09-21 01:50:43 +02:00
|
|
|
|
2019-09-21 14:40:04 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "thc-hydra";
|
2021-03-17 20:02:02 +01:00
|
|
|
version = "9.2";
|
2014-09-21 01:50:43 +02:00
|
|
|
|
2019-09-21 14:40:04 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vanhauser-thc";
|
|
|
|
repo = "thc-hydra";
|
|
|
|
rev = "v${version}";
|
2021-03-17 20:02:02 +01:00
|
|
|
sha256 = "sha256-V9rr5fbJWm0pa+Kp8g95XvLPo/uWcDwyU2goImnIq58=";
|
2014-09-21 01:50:43 +02:00
|
|
|
};
|
|
|
|
|
2019-09-21 14:40:04 +02:00
|
|
|
postPatch = let
|
|
|
|
makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
|
|
|
|
in ''
|
2016-08-11 12:49:10 +02:00
|
|
|
substituteInPlace configure \
|
2019-09-21 14:40:04 +02:00
|
|
|
--replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \
|
|
|
|
--replace '$INCDIRS' "${makeDirs "dev" "include"}" \
|
2016-08-11 19:16:45 +02:00
|
|
|
--replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
|
2016-08-11 12:49:10 +02:00
|
|
|
--replace "libcurses.so" "libncurses.so" \
|
|
|
|
--replace "-lcurses" "-lncurses"
|
2014-09-21 01:50:43 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-17 04:51:22 +01:00
|
|
|
nativeBuildInputs = lib.optionals withGUI [ pkg-config makeWrapper ];
|
2019-09-21 14:40:04 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
2019-09-26 00:52:30 +02:00
|
|
|
zlib openssl ncurses libidn pcre libssh libmysqlclient postgresql
|
2019-09-21 14:40:04 +02:00
|
|
|
] ++ lib.optional withGUI gtk2;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
DATADIR = "/share/${pname}";
|
2014-09-21 01:50:43 +02:00
|
|
|
|
2016-08-11 12:49:10 +02:00
|
|
|
postInstall = lib.optionalString withGUI ''
|
|
|
|
wrapProgram $out/bin/xhydra \
|
|
|
|
--add-flags --hydra-path --add-flags "$out/bin/hydra"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-09-21 01:50:43 +02:00
|
|
|
description = "A very fast network logon cracker which support many different services";
|
2019-09-21 14:40:04 +02:00
|
|
|
homepage = "https://www.thc.org/thc-hydra/";
|
2014-09-21 01:50:43 +02:00
|
|
|
license = licenses.agpl3;
|
2019-09-21 14:40:04 +02:00
|
|
|
maintainers = with maintainers; [ offline ];
|
2016-08-11 12:49:10 +02:00
|
|
|
platforms = platforms.linux;
|
2014-09-21 01:50:43 +02:00
|
|
|
};
|
|
|
|
}
|