about summary refs log tree commit diff
path: root/pkgs/by-name/ad/ad-ldap-enum/package.nix
blob: 5d868bf1dd4e59f9d543c9a6fc52aa4ee07969e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, stdenvNoCC
, fetchFromGitHub
, python3
}:

stdenvNoCC.mkDerivation {
  pname = "ad-ldap-enum";
  version = "0-unstable-2023-02-10";
  src = fetchFromGitHub {
    owner = "CroweCybersecurity";
    repo = "ad-ldap-enum";
    rev = "60bc5bb111e2708d4bc2157f9ae3d5e0d06ece75";
    hash = "sha256-b77yWmZGyOSQSwnRhGqo501jO6XYd+qpx1pb+zkduVI=";
  };

  buildInputs = [
    (python3.withPackages (ps: with ps; [
      argcomplete
      ldap3
      openpyxl
    ]))
  ];

  installPhase = ''
    runHook preInstall

    install -Dm555 ad-ldap-enum.py $out/bin/ad-ldap-enum

    runHook postInstall
  '';

  fixupPhase = ''
    runHook preFixup

    patchShebangs $out/bin/ad-ldap-enum

    runHook postFixup
  '';

  meta = with lib; {
    description = "An LDAP based Active Directory user and group enumeration tool";
    homepage = "https://github.com/CroweCybersecurity/ad-ldap-enum";
    license = licenses.mit;
    maintainers = with maintainers; [ h7x4 ];
    platforms = python3.meta.platforms;
    mainProgram = "ad-ldap-enum";
  };
}