web.nix (1865B)
1 # modules/features/pentest/web.nix — web application testing. 2 # 3 # The GUI proxies (burpsuite, zap) are in gui.nix, not here, so a headless 4 # session can enable `web` without pulling a JDK and a desktop entry. 5 { lib, ... }: 6 (import ./_sets.nix { inherit lib; }) { 7 name = "web"; 8 description = "directory fuzzing, injection, scanners, proxies"; 9 10 packages = pkgs: with pkgs; [ 11 ffuf gobuster feroxbuster dirb 12 nikto sqlmap commix wfuzz 13 nuclei nuclei-templates 14 wpscan 15 joomscan # binary is `joomscan.pl` 16 dalfox arjun 17 jwt-cli # `jwt` 18 jwt-hack 19 mitmproxy 20 wafw00f # is there a WAF in front, and whose 21 ghauri # sqli where sqlmap's payloads get filtered 22 hakrawler 23 interactsh # `interactsh-client`: OOB callbacks for blind SSRF/XXE/RCE 24 ]; 25 26 expectedBins = [ 27 "ffuf" "gobuster" "feroxbuster" "dirb" 28 "nikto" "sqlmap" "commix" "wfuzz" 29 "nuclei" "wpscan" "joomscan.pl" "dalfox" "arjun" 30 "jwt" "jwt-hack" "mitmproxy" 31 "wafw00f" "ghauri" "hakrawler" "interactsh-client" 32 ]; 33 34 # The variable name is asserted against the binary: setting one nuclei does 35 # not read is silent, and the first version of this set NUCLEI_TEMPLATES, 36 # which nuclei ignores — so it still downloaded templates to $HOME while the 37 # comment claimed otherwise. 38 checkScript = { pkgs, lib }: '' 39 if ! grep -aq 'NUCLEI_TEMPLATES_DIR' ${pkgs.nuclei}/bin/nuclei; then 40 echo "pentest-web: nuclei no longer reads NUCLEI_TEMPLATES_DIR;" >&2 41 echo " check its env vars and update web.nix" >&2 42 exit 1 43 fi 44 ''; 45 46 extraConfig = { pkgs, ... }: { 47 # nuclei writes its template tree to $HOME on first run and then tries to 48 # update it over the network. Point it at the Nix copy instead. 49 environment.sessionVariables.NUCLEI_TEMPLATES_DIR = 50 "${pkgs.nuclei-templates}/share/nuclei-templates"; 51 }; 52 }