diff options
Diffstat (limited to 'pkgs/tools/networking')
-rw-r--r-- | pkgs/tools/networking/aircrack-ng/default.nix | 109 | ||||
-rw-r--r-- | pkgs/tools/networking/httping/default.nix | 63 |
2 files changed, 89 insertions, 83 deletions
diff --git a/pkgs/tools/networking/aircrack-ng/default.nix b/pkgs/tools/networking/aircrack-ng/default.nix index b4cab28e3ebd..6bfd3136dc98 100644 --- a/pkgs/tools/networking/aircrack-ng/default.nix +++ b/pkgs/tools/networking/aircrack-ng/default.nix @@ -1,34 +1,103 @@ -{ lib, stdenv, fetchurl, libpcap, openssl, zlib, wirelesstools -, iw, ethtool, pciutils, libnl, pkg-config, makeWrapper -, autoreconfHook, usbutils }: +{ lib +, stdenv +, fetchFromGitHub +, fetchzip +, makeWrapper +, autoreconfHook +, pkg-config +, openssl +, libgcrypt +, cmocka +, expect +, sqlite +, pcre2 + # Linux +, libpcap +, zlib +, wirelesstools +, iw +, ethtool +, pciutils +, libnl +, usbutils +, tcpdump +, hostapd +, wpa_supplicant +, screen + + # Cygwin +, libiconv + + # options +, enableExperimental ? true +, useGcrypt ? false +, enableAirolib ? true +, enableRegex ? true +, useAirpcap ? stdenv.isCygwin +}: +let + airpcap-sdk = fetchzip { + pname = "airpcap-sdk"; + version = "4.1.1"; + url = "https://support.riverbed.com/bin/support/download?sid=l3vk3eu649usgu3rj60uncjqqu"; + hash = "sha256-kJhnUvhnF9F/kIJx9NcbRUfIXUSX/SRaO/SWNvdkVT8="; + stripRoot = false; + extension = "zip"; + }; +in stdenv.mkDerivation rec { pname = "aircrack-ng"; version = "1.7"; - src = fetchurl { - url = "https://download.aircrack-ng.org/aircrack-ng-${version}.tar.gz"; - sha256 = "1hsq1gwmafka4bahs6rc8p98yi542h9a502h64bjlygpr3ih99q5"; + src = fetchFromGitHub { + owner = "aircrack-ng"; + repo = "aircrack-ng"; + rev = version; + hash = "sha256-niQDwiqi5GtBW5HIn0endnqPb/MqllcjsjXw4pTyFKY="; }; + postPatch = lib.optionalString stdenv.isLinux '' + substituteInPlace lib/osdep/linux.c --replace-warn /usr/local/bin ${lib.escapeShellArg (lib.makeBinPath [ + wirelesstools + ])} + ''; + + configureFlags = [ + (lib.withFeature enableExperimental "experimental") + (lib.withFeature useGcrypt "gcrypt") + (lib.withFeatureAs useAirpcap "airpcap" airpcap-sdk) + ]; + nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook ]; - buildInputs = [ libpcap openssl zlib libnl iw ethtool pciutils ]; + buildInputs = + lib.singleton (if useGcrypt then libgcrypt else openssl) + ++ lib.optionals stdenv.isLinux [ libpcap zlib libnl iw ethtool pciutils ] + ++ lib.optional (stdenv.isCygwin && stdenv.isClang) libiconv + ++ lib.optional enableAirolib sqlite + ++ lib.optional enableRegex pcre2 + ++ lib.optional useAirpcap airpcap-sdk; - patchPhase = '' - sed -e 's@/usr/local/bin@'${wirelesstools}@ -i lib/osdep/linux.c - ''; + nativeCheckInputs = [ cmocka expect ]; - postFixup = '' - wrapProgram $out/bin/airmon-ng --prefix PATH : ${lib.makeBinPath [ - ethtool iw pciutils usbutils - ]} + postFixup = lib.optionalString stdenv.isLinux '' + wrapProgram "$out/bin/airmon-ng" --prefix PATH : ${lib.escapeShellArg (lib.makeBinPath [ + ethtool + iw + pciutils + usbutils + ])} ''; - meta = with lib; { - description = "Wireless encryption cracking tools"; - homepage = "http://www.aircrack-ng.org/"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; - platforms = platforms.linux; + installCheckTarget = "integration"; + nativeInstallCheckInputs = [ cmocka expect ] ++ lib.optionals stdenv.isLinux [ tcpdump hostapd wpa_supplicant screen ]; + + meta = { + description = "WiFi security auditing tools suite"; + homepage = "https://www.aircrack-ng.org/"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ caralice ]; + platforms = with lib.platforms; builtins.concatLists [ linux darwin cygwin netbsd openbsd freebsd illumos ]; + changelog = "https://github.com/aircrack-ng/aircrack-ng/blob/${src.rev}/ChangeLog"; }; } diff --git a/pkgs/tools/networking/httping/default.nix b/pkgs/tools/networking/httping/default.nix deleted file mode 100644 index 1933dc41de0f..000000000000 --- a/pkgs/tools/networking/httping/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, fetchpatch -, fftw ? null -, gettext -, libintl -, ncurses -, openssl -}: - -stdenv.mkDerivation rec { - pname = "httping"; - version = "2.9"; - - src = fetchFromGitHub { - owner = "folkertvanheusden"; - repo = "HTTPing"; - rev = "v${version}"; - hash = "sha256-aExTXXtW03UKMuMjTMx1k/MUpcRMh1PdSPkDGH+Od70="; - }; - - patches = [ - # Pull upstream fix for missing <unistd.h> - # https://github.com/folkertvanheusden/HTTPing/pull/8 - (fetchpatch { - name = "add-unistd.patch"; - url = "https://github.com/folkertvanheusden/HTTPing/commit/aad3c275686344fe9a235faeac4ee3832f3aa8d5.patch"; - hash = "sha256-bz3AMQTSfSTwUyf9WbkAFWVmFo06ei+Qd55x+RRDREY="; - }) - ]; - - nativeBuildInputs = [ - gettext - ]; - - buildInputs = [ - fftw - libintl - ncurses - openssl - ]; - - makeFlags = [ - "DESTDIR=$(out)" - "PREFIX=" - ]; - - meta = with lib; { - homepage = "https://vanheusden.com/httping"; - description = "ping with HTTP requests"; - longDescription = '' - Give httping an url, and it'll show you how long it takes to connect, - send a request and retrieve the reply (only the headers). Be aware that - the transmission across the network also takes time! So it measures the - latency of the webserver + network. It supports IPv6. - ''; - license = licenses.agpl3Only; - maintainers = []; - platforms = platforms.linux ++ platforms.darwin; - mainProgram = "httping"; - }; -} |