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