2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
2024-02-07 01:22:34 +00:00
|
|
|
, stdenv
|
2024-01-13 08:15:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
impacket = super.impacket.overridePythonAttrs {
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.12.0.dev1-unstable-2023-11-30";
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Pennyw0rth";
|
|
|
|
repo = "impacket";
|
|
|
|
rev = "d370e6359a410063b2c9c68f6572c3b5fb178a38";
|
|
|
|
hash = "sha256-Jozn4lKAnLQ2I53+bx0mFY++OH5P4KyqVmrS5XJUY3E=";
|
|
|
|
};
|
2024-02-07 01:22:34 +00:00
|
|
|
# Fix version to be compliant with Python packaging rules
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'version="{}.{}.{}.{}{}"' 'version="{}.{}.{}"'
|
|
|
|
'';
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "netexec";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.1.0-unstable-2024-01-15";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
|
|
|
pythonRelaxDeps = true;
|
2024-02-07 01:22:34 +00:00
|
|
|
pythonRemoveDeps = [
|
|
|
|
# Fail to detect dev version requirement
|
|
|
|
"neo4j"
|
|
|
|
];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Pennyw0rth";
|
|
|
|
repo = "NetExec";
|
2024-02-07 01:22:34 +00:00
|
|
|
rev = "9df72e2f68b914dfdbd75b095dd8f577e992615f";
|
|
|
|
hash = "sha256-oQHtTE5hdlxHX4uc412VfNUrN0UHVbwI0Mm9kmJpNW4=";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '{ git = "https://github.com/Pennyw0rth/impacket.git", branch = "gkdi" }' '"*"' \
|
|
|
|
--replace '{ git = "https://github.com/Pennyw0rth/oscrypto" }' '"*"'
|
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [
|
|
|
|
poetry-core
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2024-02-07 01:22:34 +00:00
|
|
|
aardwolf
|
|
|
|
aioconsole
|
|
|
|
aiosqlite
|
|
|
|
argcomplete
|
|
|
|
asyauth
|
2024-01-13 08:15:51 +00:00
|
|
|
beautifulsoup4
|
2024-02-07 01:22:34 +00:00
|
|
|
bloodhound-py
|
|
|
|
dploot
|
|
|
|
dsinternals
|
|
|
|
impacket
|
2024-01-13 08:15:51 +00:00
|
|
|
lsassy
|
2024-02-07 01:22:34 +00:00
|
|
|
masky
|
|
|
|
minikerberos
|
2024-01-13 08:15:51 +00:00
|
|
|
msgpack
|
|
|
|
neo4j
|
2024-02-07 01:22:34 +00:00
|
|
|
oscrypto
|
|
|
|
paramiko
|
|
|
|
pyasn1-modules
|
2024-01-13 08:15:51 +00:00
|
|
|
pylnk3
|
|
|
|
pypsrp
|
|
|
|
pypykatz
|
|
|
|
python-libnmap
|
2024-02-07 01:22:34 +00:00
|
|
|
pywerview
|
|
|
|
requests
|
|
|
|
rich
|
|
|
|
sqlalchemy
|
|
|
|
termcolor
|
|
|
|
terminaltables
|
|
|
|
xmltodict
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2024-02-07 01:22:34 +00:00
|
|
|
pytestCheckHook
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
2024-01-13 08:15:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-02-07 01:22:34 +00:00
|
|
|
description = "Network service exploitation tool (maintained fork of CrackMapExec)";
|
2024-01-13 08:15:51 +00:00
|
|
|
homepage = "https://github.com/Pennyw0rth/NetExec";
|
|
|
|
changelog = "https://github.com/Pennyw0rth/NetExec/releases/tag/v${version}";
|
|
|
|
license = with licenses; [ bsd2 ];
|
|
|
|
mainProgram = "nxc";
|
|
|
|
maintainers = with maintainers; [ vncsb ];
|
2024-02-07 01:22:34 +00:00
|
|
|
# FIXME: failing fixupPhase:
|
|
|
|
# $ Rewriting #!/nix/store/<hash>-python3-3.11.7/bin/python3.11 to #!/nix/store/<hash>-python3-3.11.7
|
|
|
|
# $ /nix/store/<hash>-wrap-python-hook/nix-support/setup-hook: line 65: 47758 Killed: 9 sed -i "$f" -e "1 s^#!/nix/store/<hash>-python3-3.11.7^#!/nix/store/<hash>-python3-3.11.7^"
|
|
|
|
broken = stdenv.isDarwin;
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
}
|