# modules/features/pentest/wordlists.nix — $WORDLISTS, the tree every fuzzer # and cracker is pointed at. # # $WORDLISTS/rockyou.txt 14 M passwords, plain text # $WORDLISTS/seclists/ the SecLists checkout (1.9 G) # $WORDLISTS/nmap.lst wfuzz/ the smaller sets # # nixpkgs' `wordlists` already aggregates seclists, rockyou, nmap.lst and wfuzz # under one share/wordlists, and already ships rockyou DECOMPRESSED — so this # module points at that tree instead of rebuilding it. The check still asserts # rockyou is plain text: it has shipped gzipped before, and a gzip magic number # would make every `hashcat ... rockyou.txt` silently crack nothing. # # `wordlists` also provides `wordlists_path`, so the shell can find the tree # without $WORDLISTS. { lib, ... }: (import ./_sets.nix { inherit lib; }) { name = "wordlists"; description = "seclists, rockyou and the exploit-db archive"; packages = pkgs: [ pkgs.wordlists # seclists + rockyou + nmap.lst + wfuzz, and `wordlists_path` pkgs.exploitdb # `searchsploit` ]; expectedBins = [ "wordlists_path" "searchsploit" ]; checkScript = { pkgs, lib }: '' dir=${pkgs.wordlists}/share/wordlists for p in rockyou.txt seclists nmap.lst; do if [ ! -e "$dir/$p" ]; then echo "pentest-wordlists: $dir/$p is missing" >&2 exit 1 fi done if [ "$(head -c2 "$dir/rockyou.txt" | od -An -tx1 | tr -d ' ')" = "1f8b" ]; then echo "pentest-wordlists: rockyou.txt is gzipped, not plain text" >&2 exit 1 fi ''; extraConfig = { pkgs, lib, ... }: { environment.sessionVariables.WORDLISTS = lib.mkForce "${pkgs.wordlists}/share/wordlists"; }; }