From d9df6704925644531ec936a6d2f1129370e687af Mon Sep 17 00:00:00 2001 From: bad Date: Sat, 26 Feb 2022 14:00:34 +0100 Subject: [PATCH] Add wordlists --- flake.nix | 3 ++- wordlists/default.nix | 53 +++++++++++++++++++++++++++++++++++++++++ wordlists/dirbuster.nix | 23 ++++++++++++++++++ wordlists/nmap.nix | 29 ++++++++++++++++++++++ wordlists/rockyou.nix | 32 +++++++++++++++++++++++++ wordlists/seclists.nix | 29 ++++++++++++++++++++++ 6 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 wordlists/default.nix create mode 100644 wordlists/dirbuster.nix create mode 100644 wordlists/nmap.nix create mode 100644 wordlists/rockyou.nix create mode 100644 wordlists/seclists.nix diff --git a/flake.nix b/flake.nix index e5075df..ad7cba6 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ flake-utils.lib.eachDefaultSystem (system: let - nixpkgs = import self.inputs.nixpkgs { system = system; }; + nixpkgs = import self.inputs.nixpkgs { system = system; config.allowUnfree = true; }; in rec { packages.jwt-tool = (import ./jwt-tool.nix { inherit nixpkgs jwt-tool; }); @@ -30,6 +30,7 @@ type = "app"; program = "${packages.pycdc}/bin/pycdc"; }; + packages.wordlists = (nixpkgs.callPackage ./wordlists/default.nix {} ); } ); } diff --git a/wordlists/default.nix b/wordlists/default.nix new file mode 100644 index 0000000..4a8a5f6 --- /dev/null +++ b/wordlists/default.nix @@ -0,0 +1,53 @@ +{ callPackage +, lib +, pkgs +, runtimeShell +, symlinkJoin +, tree +, wfuzz +}: + +let + scopedWordlists = lib.makeScope pkgs.newScope (_: + { + dirbuster = callPackage ./dirbuster.nix { }; + nmap = callPackage ./nmap.nix { }; + rockyou = callPackage ./rockyou.nix { }; + seclists = callPackage ./seclists.nix { }; + wfuzz = wfuzz.wordlists; + } + ); +in +{ + pkgs = scopedWordlists; + withLists = f: symlinkJoin rec { + pname = "security-wordlists"; + version = "unstable-2020-11-23"; + + name = "${pname}-${version}"; + paths = f scopedWordlists; + + postBuild = '' + # Create a command to show the location of the links. + mkdir -p $out/bin + cat >> $out/bin/wordlists << __EOF__ + #!${runtimeShell} + ${tree}/bin/tree $out/share + __EOF__ + chmod +x $out/bin/wordlists + + # Create a handy command for easy access to the wordlists. + # e.g.: `cat "$(wordlists_path)/rockyou.txt"`, or `ls "$(wordlists_path)/dirbuster"` + cat >> $out/bin/wordlists_path << __EOF__ + #!${runtimeShell} + echo $out/share + __EOF__ + chmod +x $out/bin/wordlists_path + ''; + + meta = with lib; { + description = "A collection of wordlists useful for security testing"; + maintainers = with maintainers; [ pamplemousse ]; + }; + }; +} diff --git a/wordlists/dirbuster.nix b/wordlists/dirbuster.nix new file mode 100644 index 0000000..aa80112 --- /dev/null +++ b/wordlists/dirbuster.nix @@ -0,0 +1,23 @@ +{ fetchzip, lib }: + +let + version = "1.0-RC1"; + +in +fetchzip rec { + name = "DirBuster-${version}"; + + url = "mirror://sourceforge/dirbuster/DirBuster%20%28jar%20%2B%20lists%29/${version}/${name}.zip"; + sha256 = "nByEKfhJ5TsZjvL4dTcgrSw0kUUPPVQNJOywdlZwiTo="; + + postFetch = '' + mkdir -p $out/share/dirbuster + unzip -j $downloadedFile ${name}/directory-list-\*.txt -d $out/share/dirbuster + ''; + + meta = with lib; { + homepage = "https://sourceforge.net/projects/dirbuster/"; + license = licenses.cc-by-nc-sa-30; + maintainers = with maintainers; [ pamplemousse ]; + }; +} diff --git a/wordlists/nmap.nix b/wordlists/nmap.nix new file mode 100644 index 0000000..7ae2e34 --- /dev/null +++ b/wordlists/nmap.nix @@ -0,0 +1,29 @@ +{ fetchFromGitHub +, lib +, nmap +, stdenvNoCC +}: + +stdenvNoCC.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"; + + dontUnpack = true; + + installPhase = '' + install -m 444 -D $src $out/share/nmap.lst + ''; + + meta = with lib; { + inherit (nmap.meta) homepage license; + maintainers = with maintainers; [ pamplemousse ]; + }; +} diff --git a/wordlists/rockyou.nix b/wordlists/rockyou.nix new file mode 100644 index 0000000..ad485e3 --- /dev/null +++ b/wordlists/rockyou.nix @@ -0,0 +1,32 @@ +{ fetchFromGitLab +, lib +, stdenvNoCC +}: + +stdenvNoCC.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"; + + unpackCmd = '' + mkdir src + gzip -dc ${src} > src/rockyou.txt + ''; + + installPhase = '' + install -m 444 -D rockyou.txt $out/share/rockyou.txt + ''; + + meta = with lib; { + license = "unknown"; + maintainers = with maintainers; [ pamplemousse ]; + }; +} diff --git a/wordlists/seclists.nix b/wordlists/seclists.nix new file mode 100644 index 0000000..7b637bf --- /dev/null +++ b/wordlists/seclists.nix @@ -0,0 +1,29 @@ +{ fetchFromGitHub +, lib +, stdenvNoCC +}: + +stdenvNoCC.mkDerivation rec { + pname = "SecLists"; + version = "unstable-2020-11-11"; + + src = fetchFromGitHub { + owner = "danielmiessler"; + repo = pname; + rev = "9f4d672e98a837fb1f3d59095df36b63af6987d1"; + sha256 = "EoLX4LmftkUZXbwGHLigbgC5bj23UL72k4li42YRzSs="; + }; + + installPhase = '' + mkdir -p $out/share/SecLists + cp -R Discovery Fuzzing IOCs Miscellaneous Passwords Pattern-Matching Payloads Usernames Web-Shells \ + $out/share/SecLists + find $out/share/SecLists -name "*.md" -delete + ''; + + meta = with lib; { + homepage = "https://github.com/danielmiessler/SecLists"; + license = licenses.mit; + maintainers = with maintainers; [ pamplemousse ]; + }; +}