From 439e1b00da2bb91ca964c3c7f1de4c522faff51e Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Sun, 15 Jan 2023 21:43:10 -0500 Subject: [PATCH] replace security-wordlists with seclists --- modules/security-tools.nix | 7 ++++++- pkgs/seclists.nix | 15 +++++++++++++++ pkgs/security-wordlists.nix | 37 ------------------------------------- 3 files changed, 21 insertions(+), 38 deletions(-) create mode 100644 pkgs/seclists.nix delete mode 100644 pkgs/security-wordlists.nix diff --git a/modules/security-tools.nix b/modules/security-tools.nix index 616f9b4..01959ac 100644 --- a/modules/security-tools.nix +++ b/modules/security-tools.nix @@ -31,7 +31,7 @@ in postman pwndbg remmina - security-wordlists + seclists socat thc-hydra webshells @@ -39,6 +39,11 @@ in wfuzz ]; + system.activationScripts.seclists = '' + mkdir -m 0755 -p /usr/share + ln -sf /run/current-system/sw/share/seclists /usr/share/ + ''; + programs = { wireshark.enable = true; wireshark.package = pkgs.wireshark; diff --git a/pkgs/seclists.nix b/pkgs/seclists.nix new file mode 100644 index 0000000..2696b64 --- /dev/null +++ b/pkgs/seclists.nix @@ -0,0 +1,15 @@ +{ fetchFromGitHub, runCommand }: +let + + src = fetchFromGitHub { + owner = "danielmiessler"; + repo = "SecLists"; + rev = "2022.4"; + sha256 = "CCj662K1+CstJmFKeB+vbPomkxyErzY3mJcOrWs9cf4="; + }; + +in +runCommand "seclists" { } '' + mkdir -p $out/share + ln -s ${src} $out/share/seclists +'' diff --git a/pkgs/security-wordlists.nix b/pkgs/security-wordlists.nix deleted file mode 100644 index 1109eba..0000000 --- a/pkgs/security-wordlists.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib -, curl -, fetchFromGitHub -, nmap -, runCommand -, wfuzz -}: -let - - seclists = fetchFromGitHub { - owner = "danielmiessler"; - repo = "SecLists"; - rev = "2022.3"; - sha256 = "Q8d3aYRdmFxIcL47eeZnC57X5LaGshEimlsOH6+3Ahk="; - }; - - dirbuster = runCommand "dirbuster" - { - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "0l2sgagdxahqi7zqqw9v9v9g2gmqbdl2cyz0rvlmc4di6crdn36s"; - } - '' - url="https://gitlab.com/kalilinux/packages/dirbuster/-/archive/upstream/1.0/dirbuster-upstream-1.0.tar.gz" - mkdir $out - ${curl}/bin/curl --insecure "$url" | - tar -C$out -xvz --strip-components=1 --wildcards '*.txt' - ''; - -in -runCommand "wordlists" { } '' - mkdir -p $out/share/wordlists - ln -s ${wfuzz.src}/wordlist $out/share/wordlists/wfuzz - ln -s ${nmap}/share/nmap/nselib/data $out/share/wordlists/nmap - ln -s ${seclists} $out/share/wordlists/seclists - ln -s ${dirbuster} $out/share/wordlists/dirbuster -''