repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
database.nixNix49 lines1.8 KiBraw download
# modules/features/pentest/database.nix — clients for the databases you find
# listening, once credentials turn up.
# Off by default. `daemon.pentest.database.enable = true;`
#
# Clients only, and that is a deliberate constraint rather than a preference:
#
#  * No `postgresql`. The bloodhound category runs a postgres SERVICE, and
#    NixOS puts that service's package (17.x) into environment.systemPackages
#    itself. Adding `pkgs.postgresql` (currently 18.x) would give two store
#    paths owning bin/psql, which is a profile collision that stops the whole
#    system building. So `psql` comes from the bloodhound category, and this
#    one brings `pgcli`, which is a better interactive client anyway.
#  * `mariadb.client`, not `mariadb` — the latter is the server, and installs
#    mariadbd and its data-directory tooling for nothing.
#
# sqlmap is in web.nix: it is an injection tool, not a database client.
{ lib, ... }:
(import ./_sets.nix { inherit lib; }) {
  name = "database";
  description = "mysql, postgres, mssql, redis and mongo clients";
  default = false;

  packages = pkgs: with pkgs; [
    mariadb.client # `mysql`, `mariadb`, `mysqldump` — MySQL and MariaDB
    mycli # the same with completion and history

    pgcli # postgres; `psql` itself comes with the bloodhound category

    # MSSQL, which is what an AD estate actually runs
    freetds # `tsql` — the one that works with just a host and port
    sqsh
    sqlcmd # Microsoft's own client

    (import ./_pkgs/default.nix { inherit lib pkgs; }).redis-client
    mongosh

    usql # one client for all of the above, by URL
  ];

  expectedBins = [
    "mysql" "mariadb" "mysqldump" "mycli"
    "pgcli"
    "tsql" "bsqldb" "sqsh" "sqlcmd"
    "redis-cli" "mongosh"
    "usql"
  ];

  smokeBins = [ "mycli" "pgcli" "usql" ];
}