2024-09-19 14:19:46 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql, samba
|
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";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "9.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vanhauser-thc";
|
|
|
|
repo = "thc-hydra";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-gdMxdFrBGVHA1ZBNFW89PBXwACnXTGJ/e/Z5+xVV5F0=";
|
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 \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail '$LIBDIRS' "${makeDirs "lib" "lib"}" \
|
|
|
|
--replace-fail '$INCDIRS' "${makeDirs "dev" "include"}" \
|
|
|
|
--replace-fail "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
|
|
|
|
--replace-fail "libcurses.so" "libncurses.so" \
|
|
|
|
--replace-fail "-lcurses" "-lncurses"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-undef-prefix";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
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
|
2024-09-19 14:19:46 +00:00
|
|
|
samba
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ 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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Very fast network logon cracker which support many different services";
|
2022-02-20 05:27:41 +00:00
|
|
|
homepage = "https://github.com/vanhauser-thc/thc-hydra"; # https://www.thc.org/
|
|
|
|
changelog = "https://github.com/vanhauser-thc/thc-hydra/raw/v${version}/CHANGES";
|
|
|
|
license = licenses.agpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ offline ];
|
2022-02-10 20:34:41 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|