From aa7ef89f480f55e369b1b817ab4238d2888bd74b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Jun 2022 09:00:28 +0200 Subject: [PATCH 1/6] python310Packages.psrpcore: init at 0.1.2 --- .../python-modules/psrpcore/default.nix | 44 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 6 ++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/psrpcore/default.nix diff --git a/pkgs/development/python-modules/psrpcore/default.nix b/pkgs/development/python-modules/psrpcore/default.nix new file mode 100644 index 000000000000..41c514d2ca63 --- /dev/null +++ b/pkgs/development/python-modules/psrpcore/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildPythonPackage +, cryptography +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, xmldiff +}: + +buildPythonPackage rec { + pname = "psrpcore"; + version = "0.1.2"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "jborean93"; + repo = pname; + rev = "v${version}"; + hash = "sha256-f1NGE+wSgi8yqBicZZRfUqzinsqazuIaoAje2y+dK1w="; + }; + + propagatedBuildInputs = [ + cryptography + ]; + + checkInputs = [ + pytestCheckHook + xmldiff + ]; + + + pythonImportsCheck = [ + "psrpcore" + ]; + + meta = with lib; { + description = "Library for the PowerShell Remoting Protocol (PSRP)"; + homepage = "https://github.com/jborean93/psrpcore"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2e553cf8addf..b8733f1d673d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6445,11 +6445,13 @@ in { pencompy = callPackage ../development/python-modules/pencompy { }; + phonopy = callPackage ../development/python-modules/phonopy { }; + pixcat = callPackage ../development/python-modules/pixcat { }; - pyprecice = callPackage ../development/python-modules/pyprecice { }; + psrpcore = callPackage ../development/python-modules/psrpcore { }; - phonopy = callPackage ../development/python-modules/phonopy { }; + pyprecice = callPackage ../development/python-modules/pyprecice { }; phpserialize = callPackage ../development/python-modules/phpserialize { }; From fdc59cca1e27b9e87ca93af388d28879bffaf129 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Jun 2022 09:24:30 +0200 Subject: [PATCH 2/6] python310Packages.requests-credssp: init at 2.0.0 --- .../requests-credssp/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/requests-credssp/default.nix diff --git a/pkgs/development/python-modules/requests-credssp/default.nix b/pkgs/development/python-modules/requests-credssp/default.nix new file mode 100644 index 000000000000..20ce327b4eda --- /dev/null +++ b/pkgs/development/python-modules/requests-credssp/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, cryptography +, fetchFromGitHub +, gssapi +, krb5 +, pyspnego +, pytestCheckHook +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "requests-credssp"; + version = "2.0.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "jborean93"; + repo = pname; + rev = "v${version}"; + hash = "sha256-HHLEmQ+mNjMjpR6J+emrKFM+2PiYq32o7Gnoo0gUrNA="; + }; + + propagatedBuildInputs = [ + cryptography + pyspnego + requests + ]; + + checkInputs = [ + pytestCheckHook + ]; + + passthru.optional-dependencies = { + kerberos = [ + # pyspnego[kerberos] will have those two dependencies + gssapi + krb5 + ]; + }; + + pythonImportsCheck = [ + "requests_credssp" + ]; + + meta = with lib; { + description = "HTTPS CredSSP authentication with the requests library"; + homepage = "https://github.com/jborean93/requests-credssp"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b8733f1d673d..d553d1d7a806 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9142,6 +9142,8 @@ in { requests-cache = callPackage ../development/python-modules/requests-cache { }; + requests-credssp = callPackage ../development/python-modules/requests-credssp { }; + requests-hawk = callPackage ../development/python-modules/requests-hawk { }; requests = callPackage ../development/python-modules/requests { }; From 45ec571176094f3a647a844fce9666398e5aa6fb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Jun 2022 09:25:15 +0200 Subject: [PATCH 3/6] python310Packages.pypsrp: init at 0.8.1 --- .../python-modules/pypsrp/default.nix | 79 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 81 insertions(+) create mode 100644 pkgs/development/python-modules/pypsrp/default.nix diff --git a/pkgs/development/python-modules/pypsrp/default.nix b/pkgs/development/python-modules/pypsrp/default.nix new file mode 100644 index 000000000000..7246af07e382 --- /dev/null +++ b/pkgs/development/python-modules/pypsrp/default.nix @@ -0,0 +1,79 @@ +{ lib +, asyncssh +, buildPythonPackage +, cryptography +, fetchFromGitHub +, gssapi +, httpcore +, httpx +, krb5 +, psrpcore +, psutil +, pyspnego +, pytest-mock +, pytestCheckHook +, pythonOlder +, pyyaml +, requests +, requests-credssp +, xmldiff +}: + +buildPythonPackage rec { + pname = "pypsrp"; + version = "0.8.1"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "jborean93"; + repo = pname; + rev = "v${version}"; + hash = "sha256-Pwfc9e39sYPdcHN1cZtxxGEglEYzPp4yOYLD5/4SSiU="; + }; + + propagatedBuildInputs = [ + cryptography + httpcore + httpx + psrpcore + pyspnego + requests + ]; + + checkInputs = [ + pytest-mock + pytestCheckHook + pyyaml + xmldiff + ]; + + passthru.optional-dependencies = { + credssp = [ + requests-credssp + ]; + kerberos = [ + # pyspnego[kerberos] will have those two dependencies + gssapi + krb5 + ]; + named_pipe = [ + psutil + ]; + ssh = [ + asyncssh + ]; + }; + + pythonImportsCheck = [ + "pypsrp" + ]; + + meta = with lib; { + description = "PowerShell Remoting Protocol Client library"; + homepage = "https://github.com/jborean93/pypsrp"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d553d1d7a806..6c746cc814da 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6453,6 +6453,8 @@ in { pyprecice = callPackage ../development/python-modules/pyprecice { }; + pypsrp = callPackage ../development/python-modules/pypsrp { }; + phpserialize = callPackage ../development/python-modules/phpserialize { }; phx-class-registry = callPackage ../development/python-modules/phx-class-registry { }; From eba9d69732a22430e0717096889d23c46a56373b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Jun 2022 09:41:17 +0200 Subject: [PATCH 4/6] python310Packages.neo4j: fix name --- .../python-modules/{neo4j-driver => neo4j}/default.nix | 4 ++-- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename pkgs/development/python-modules/{neo4j-driver => neo4j}/default.nix (86%) diff --git a/pkgs/development/python-modules/neo4j-driver/default.nix b/pkgs/development/python-modules/neo4j/default.nix similarity index 86% rename from pkgs/development/python-modules/neo4j-driver/default.nix rename to pkgs/development/python-modules/neo4j/default.nix index fc5b98dd448e..8a0d1ce39439 100644 --- a/pkgs/development/python-modules/neo4j-driver/default.nix +++ b/pkgs/development/python-modules/neo4j/default.nix @@ -6,7 +6,7 @@ }: buildPythonPackage rec { - pname = "neo4j-driver"; + pname = "neo4j"; version = "4.4.4"; format = "setuptools"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "neo4j"; repo = "neo4j-python-driver"; rev = version; - sha256 = "sha256-Sd+ZeyJCzqGsBl3rdxfKPD0gYZ49qAfiRbuXaNGpj8M="; + hash = "sha256-Sd+ZeyJCzqGsBl3rdxfKPD0gYZ49qAfiRbuXaNGpj8M="; }; propagatedBuildInputs = [ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6c746cc814da..7cb4910213d1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5729,7 +5729,7 @@ in { neo = callPackage ../development/python-modules/neo { }; - neo4j-driver = callPackage ../development/python-modules/neo4j-driver { }; + neo4j = callPackage ../development/python-modules/neo4j { }; nessclient = callPackage ../development/python-modules/nessclient { }; From 332422d41089a99e2833871650616ea412c219e7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Jun 2022 10:05:46 +0200 Subject: [PATCH 5/6] python310Packages.pywerview: init at 0.4.0 --- .../python-modules/pywerview/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/pywerview/default.nix diff --git a/pkgs/development/python-modules/pywerview/default.nix b/pkgs/development/python-modules/pywerview/default.nix new file mode 100644 index 000000000000..9dbb19738bee --- /dev/null +++ b/pkgs/development/python-modules/pywerview/default.nix @@ -0,0 +1,55 @@ +{ lib +, beautifulsoup4 +, buildPythonPackage +, fetchFromGitHub +, gssapi +, impacket +, ldap3 +, lxml +, pyasn1 +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pywerview"; + version = "0.4.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "the-useless-one"; + repo = pname; + rev = "v${version}"; + hash = "sha256-nrPhyBHW13dkXFC5YJfrkiztAxMw4KuEif0zCdjQEq0="; + }; + + propagatedBuildInputs = [ + beautifulsoup4 + gssapi + impacket + ldap3 + lxml + pyasn1 + ]; + + # Module has no tests + doCheck = false; + + postPatch = '' + # https://github.com/the-useless-one/pywerview/pull/51 + substituteInPlace setup.py \ + --replace "bs4" "beautifulsoup4" + ''; + + pythonImportsCheck = [ + "pywerview" + ]; + + meta = with lib; { + description = "Module for PowerSploit's PowerView support"; + homepage = "https://github.com/the-useless-one/pywerview"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7cb4910213d1..26fb14885d6a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8885,6 +8885,8 @@ in { pywemo = callPackage ../development/python-modules/pywemo { }; + pywerview = callPackage ../development/python-modules/pywerview { }; + pywick = callPackage ../development/python-modules/pywick { }; pywilight = callPackage ../development/python-modules/pywilight { }; From 717403a6bb0463f305b163caca5c4da17135b98f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Jun 2022 11:16:12 +0200 Subject: [PATCH 6/6] crackmapexec: init at 5.2.2 --- pkgs/tools/security/crackmapexec/default.nix | 72 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 74 insertions(+) create mode 100644 pkgs/tools/security/crackmapexec/default.nix diff --git a/pkgs/tools/security/crackmapexec/default.nix b/pkgs/tools/security/crackmapexec/default.nix new file mode 100644 index 000000000000..f88563498b23 --- /dev/null +++ b/pkgs/tools/security/crackmapexec/default.nix @@ -0,0 +1,72 @@ +{ lib +, fetchFromGitHub +, fetchpatch +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "crackmapexec"; + version = "5.2.2"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "byt3bl33d3r"; + repo = "CrackMapExec"; + rev = "v${version}"; + hash = "sha256-IgD8RjwVEoEXmnHU3DR3wzUdJDWIbFw9sES5qYg30a8="; + }; + + nativeBuildInputs = with python3.pkgs; [ + poetry-core + pythonRelaxDepsHook + ]; + + propagatedBuildInputs = with python3.pkgs; [ + aioconsole + beautifulsoup4 + dsinternals + impacket + lsassy + msgpack + neo4j + paramiko + pylnk3 + pypsrp + pywerview + requests + requests_ntlm + termcolor + terminaltables + xmltodict + ]; + + patches = [ + # Switch to poetry-core, https://github.com/byt3bl33d3r/CrackMapExec/pull/580 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/byt3bl33d3r/CrackMapExec/commit/e5c6c2b5c7110035b34ea7a080defa6d42d21dd4.patch"; + hash = "sha256-5SpoQD+uSYLM6Rdq0/NTbyEv4RsBUuawNNsknS71I9M="; + }) + ]; + + pythonRelaxDeps = true; + + pythonRemoveDeps = [ + "bs4" + ]; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ + "cme" + ]; + + meta = with lib; { + description = "Tool for pentesting networks"; + homepage = "https://github.com/byt3bl33d3r/CrackMapExec"; + license = with licenses; [ bsd2 ]; + maintainers = with maintainers; [ fab ]; + mainProgram = "cme"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fa1a9c46f08b..d90b2c54e023 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4979,6 +4979,8 @@ with pkgs; cpufetch = callPackage ../tools/misc/cpufetch { }; + crackmapexec = callPackage ../tools/security/crackmapexec { }; + crackxls = callPackage ../tools/security/crackxls { }; crd2pulumi = callPackage ../development/tools/crd2pulumi { };