diff --git a/pkgs/tools/security/wordlists/default.nix b/pkgs/tools/security/wordlists/default.nix index 863e505d30f991..9561f6300f2547 100644 --- a/pkgs/tools/security/wordlists/default.nix +++ b/pkgs/tools/security/wordlists/default.nix @@ -6,26 +6,26 @@ }: let - _wordlistData = - [ { name = "dirbuster"; expressionPath = ./dirbuster.nix; } - { name = "nmap"; expressionPath = ./nmap.nix; needsPackage = true; } - { name = "rockyou"; expressionPath = ./rockyou.nix; } - { name = "seclists"; expressionPath = ./seclists.nix; } - { name = "wfuzz"; expressionPath = ./wfuzz.nix; needsPackage = true; } - ]; + _wordlistData = [ + { name = "dirbuster"; expressionPath = ./dirbuster.nix; } + { name = "nmap"; expressionPath = ./nmap.nix; needsPackage = true; } + { name = "rockyou"; expressionPath = ./rockyou.nix; } + { name = "seclists"; expressionPath = ./seclists.nix; } + { name = "wfuzz"; expressionPath = ./wfuzz.nix; needsPackage = true; } + ]; scopedWordlists = lib.makeScope pkgs.newScope (self: with self; let _packageWithLinkCommandFrom = acc: datum: # Some wordlists are based on an already existing `nixpkgs` package; Pass it as parameter of the expression. - let parameters = {} + let parameters = { } // lib.optionalAttrs ((builtins.elem "needsPackage" (builtins.attrNames datum)) && datum.needsPackage) { ${datum.name} = pkgs.${datum.name}; }; in - let p = callPackage datum.expressionPath parameters; - in acc // { ${datum.name} = p; }; - in builtins.foldl' _packageWithLinkCommandFrom {} _wordlistData + let p = callPackage datum.expressionPath parameters; + in acc // { ${datum.name} = p; }; + in builtins.foldl' _packageWithLinkCommandFrom { } _wordlistData ); - -in let +in +let packageConstructor = wordlistPackages: symlinkJoin rec { pname = "security-wordlists"; @@ -62,7 +62,8 @@ in let maintainers = with maintainers; [ pamplemousse ]; }; }; -in { +in +{ pkgs = scopedWordlists; withLists = f: packageConstructor (f scopedWordlists); } diff --git a/pkgs/tools/security/wordlists/dirbuster.nix b/pkgs/tools/security/wordlists/dirbuster.nix index 0e7ee76a0a7856..f1e8e3a01976e2 100644 --- a/pkgs/tools/security/wordlists/dirbuster.nix +++ b/pkgs/tools/security/wordlists/dirbuster.nix @@ -5,7 +5,8 @@ let version = "1.0-RC1"; -in fetchzip rec { +in +fetchzip rec { name = "DirBuster-${version}"; url = "mirror://sourceforge/dirbuster/DirBuster%20%28jar%20%2B%20lists%29/${version}/${name}.zip"; diff --git a/pkgs/tools/security/wordlists/nmap.nix b/pkgs/tools/security/wordlists/nmap.nix index e551ccbf2f971a..6fe14820988a41 100644 --- a/pkgs/tools/security/wordlists/nmap.nix +++ b/pkgs/tools/security/wordlists/nmap.nix @@ -8,12 +8,13 @@ stdenv.mkDerivation { pname = "nmap"; version = "unstable-2020-10-19"; - src = fetchFromGitHub { - owner = "nmap"; - repo = "nmap"; - rev = "0b49f7f933577a1904f232bfc2d347553ed22860"; - sha256 = "sha256-rA6cd9K2uX8EfByTJ2u2/48U4SqD9IGs+3CLlfgxHE0="; - } + "/nselib/data/passwords.lst"; + src = fetchFromGitHub + { + owner = "nmap"; + repo = "nmap"; + rev = "0b49f7f933577a1904f232bfc2d347553ed22860"; + sha256 = "sha256-rA6cd9K2uX8EfByTJ2u2/48U4SqD9IGs+3CLlfgxHE0="; + } + "/nselib/data/passwords.lst"; dontUnpack = true; diff --git a/pkgs/tools/security/wordlists/rockyou.nix b/pkgs/tools/security/wordlists/rockyou.nix index 2c0098e3d75bc7..f4cd545fb2285c 100644 --- a/pkgs/tools/security/wordlists/rockyou.nix +++ b/pkgs/tools/security/wordlists/rockyou.nix @@ -7,13 +7,14 @@ stdenv.mkDerivation rec { pname = "rockyou"; version = "0.3-1kali3"; - src = fetchFromGitLab { - group = "kalilinux"; - owner = "packages"; - repo = "wordlists"; - rev = "debian/${version}"; - sha256 = "sha256-viOd8iKLTiHrPF0azICp/F16JrPUfo4kbcGUPD2/cRs="; - } + "/rockyou.txt.gz"; + src = fetchFromGitLab + { + group = "kalilinux"; + owner = "packages"; + repo = "wordlists"; + rev = "debian/${version}"; + sha256 = "sha256-viOd8iKLTiHrPF0azICp/F16JrPUfo4kbcGUPD2/cRs="; + } + "/rockyou.txt.gz"; unpackCmd = '' mkdir src