# modules/features/pentest/core.nix — what every category assumes: the # primitives for talking to a target and the two paths the rest of the toolkit # hangs off. # # On whenever any category is on, so $PAYLOADS and $WORDLISTS always resolve. # Their values here are placeholders; wordlists.nix and payloads.nix override # them with lib.mkForce. # # `ncat` is not a top-level attribute — it ships inside nmap, which is why nmap # appears here as well as in recon.nix (Nix dedupes the closure). { lib, ... }: (import ./_sets.nix { inherit lib; }) { name = "core"; description = "pentest primitives: ncat, socat, smbclient, kerberos, ldap"; packages = pkgs: [ pkgs.nmap # ncat: the reverse-shell workhorse (--ssl, -e) pkgs.netcat-openbsd # nc: the spelling used in these writeups pkgs.socat pkgs.samba # smbclient, net pkgs.krb5 # kinit, klist — CPTS AD boxes live on these pkgs.openldap # ldapsearch pkgs.sshpass pkgs.rlwrap # line editing in a dumb reverse shell pkgs.jq # sqlite3: reading loot (browser profiles, app DBs, .db files off a box). pkgs.sqlite pkgs.dnsutils # dig, nslookup pkgs.iputils pkgs.util-linux # Explicit in the portable shell too; do not depend on the host's PATH. pkgs.curl pkgs.wget pkgs.openssh pkgs.openssl pkgs.git pkgs.file pkgs.binutils # strings (Ghost, Voleur, Snoopy) pkgs.xxd pkgs.unzip pkgs.zip pkgs.moreutils # sponge pkgs.tcpdump # Pov's ViewState proof of execution pkgs.nfs-utils # showmount, mount.nfs (VulnCicada); no NFS service (import ./_pkgs/default.nix { inherit lib pkgs; }).redis-client # Postman # Only the two clients: inetutils also exports ping, hostname and logger. (pkgs.runCommand "pentest-inet-clients" { } '' mkdir -p $out/bin for b in ftp telnet; do ln -s ${pkgs.inetutils}/bin/$b $out/bin/$b done '') ]; expectedBins = [ "ncat" "nc" "socat" "smbclient" "kinit" "ldapsearch" "sshpass" "rlwrap" "dig" "sqlite3" "column" # util-linux "curl" "wget" "ssh" "scp" "openssl" "git" "file" "strings" "xxd" "unzip" "zip" "sponge" "tcpdump" "showmount" "mount.nfs" "ftp" "telnet" "redis-cli" ]; smokeBins = [ "redis-cli" ]; extraConfig = { lib, ... }: { # Placeholders: wordlists.nix (Task 2) and payloads.nix (Task 12) take these # over with lib.mkForce. environment.sessionVariables = { PAYLOADS = lib.mkDefault "/run/current-system/sw/share/pentest/payloads"; WORDLISTS = lib.mkDefault "/run/current-system/sw/share/pentest/wordlists"; }; }; }