From f0fa89b88d4fe36742c48acaa808e4d6b492ebab Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Fri, 19 Apr 2024 20:58:47 -0400 Subject: [PATCH 1/5] Sorting dependencies --- pyproject.toml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 30b01aecb..d82710411 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,36 +34,36 @@ nxcdb = 'nxc.nxcdb:main' [tool.poetry.dependencies] python = "^3.8.0" -requests = ">=2.27.1" +aardwolf = "^0.2.7" +aioconsole = "^0.6.2" +aiosqlite = "^0.19.0" +argcomplete = "^3.1.4" +asyauth = "~0.0.14" beautifulsoup4 = ">=4.11,<5" +bloodhound = "^1.6.1" +dploot = "^2.2.1" +dsinternals = "^1.2.4" +impacket = { git = "https://github.com/fortra/impacket.git" } lsassy = ">=3.1.8" -termcolor = "2.0.1" +masky = "^0.2.0" +minikerberos = "^0.4.1" msgpack = "^1.0.0" neo4j = "^5.0.0" +paramiko = "^3.3.1" +poetry-dynamic-versioning = "^1.2.0" +pyasn1-modules = "^0.3.0" pylnk3 = "^0.4.2" pypsrp = "^0.8.1" -paramiko = "^3.3.1" -impacket = { git = "https://github.com/fortra/impacket.git" } -dsinternals = "^1.2.4" -xmltodict = "^0.13.0" -terminaltables = "^3.1.0" -aioconsole = "^0.6.2" -pywerview = "^0.3.3" # pywerview 5 requires libkrb5-dev installed which is not default on kali (as of 9/23) -minikerberos = "^0.4.1" pypykatz = "^0.6.8" -aardwolf = "^0.2.7" -dploot = "^2.2.1" -bloodhound = "^1.6.1" -asyauth = "~0.0.14" -masky = "^0.2.0" -sqlalchemy = "^2.0.4" -aiosqlite = "^0.19.0" -pyasn1-modules = "^0.3.0" -rich = "^13.3.5" -python-libnmap = "^0.7.3" -argcomplete = "^3.1.4" +pywerview = "^0.3.3" # pywerview 5 requires libkrb5-dev installed which is not default on kali (as of 9/23) python-dateutil = ">=2.8.2" -poetry-dynamic-versioning = "^1.2.0" +python-libnmap = "^0.7.3" +requests = ">=2.27.1" +rich = "^13.3.5" +sqlalchemy = "^2.0.4" +termcolor = "2.0.1" +terminaltables = "^3.1.0" +xmltodict = "^0.13.0" [tool.poetry.group.dev.dependencies] flake8 = "*" From 992ddc82b4a1cefe0951791669dcd6736b6570e8 Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Fri, 19 Apr 2024 21:39:48 -0400 Subject: [PATCH 2/5] Updating dependencies to reflect critically needed packages and current kali installations --- poetry.lock | 24 ++++++++++++------------ pyproject.toml | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/poetry.lock b/poetry.lock index a265f8fe1..d50b65a9a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -189,13 +189,13 @@ shell = ["prompt_toolkit"] [[package]] name = "asyauth" -version = "0.0.18" +version = "0.0.20" description = "Unified authentication library" optional = false python-versions = ">=3.7" files = [ - {file = "asyauth-0.0.18-py3-none-any.whl", hash = "sha256:1fff4333d5db8c6c4a897efdf5e95a41a44cd257638d8296003f1a7a4a9e95a1"}, - {file = "asyauth-0.0.18.tar.gz", hash = "sha256:b7602894fd0667cf1bd3e16a1d71c83f557a4c857ad41bddf30557a59665b4ad"}, + {file = "asyauth-0.0.20-py3-none-any.whl", hash = "sha256:b4697c5be28869bb5df8ff217564e77a863385ef9495da7cb215deac4ebe9fac"}, + {file = "asyauth-0.0.20.tar.gz", hash = "sha256:41056020f7689cf5f0a559759c7f02a6ce2719bda84df783bd1058d5781e514b"}, ] [package.dependencies] @@ -634,13 +634,13 @@ wmi = ["wmi (>=1.5.1,<2.0.0)"] [[package]] name = "dploot" -version = "2.2.4" +version = "2.7.1" description = "DPAPI looting remotely in Python" optional = false -python-versions = ">=3.7,<4.0" +python-versions = "<4.0,>=3.7" files = [ - {file = "dploot-2.2.4-py3-none-any.whl", hash = "sha256:a70c8280972a1fb7150093560093e46a9bb5936396f563ae9050a20dcf1ad96e"}, - {file = "dploot-2.2.4.tar.gz", hash = "sha256:e34ff928e94416f3cbf688427d1de4aa88a4a4a15f24edb6313a2adc685a98a3"}, + {file = "dploot-2.7.1-py3-none-any.whl", hash = "sha256:4d557a88c4fd6f6a53f45333ccb853e4125f0bf101d5336937ac1f6c0afb7171"}, + {file = "dploot-2.7.1.tar.gz", hash = "sha256:bcd2f9c6b6647d83b5d62f0446a0fdeb7eefacc6f71a49a8dd18ef43538d5db6"}, ] [package.dependencies] @@ -2175,13 +2175,13 @@ widechars = ["wcwidth"] [[package]] name = "termcolor" -version = "2.0.1" +version = "2.4.0" description = "ANSI color formatting for output in terminal" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "termcolor-2.0.1-py3-none-any.whl", hash = "sha256:7e597f9de8e001a3208c4132938597413b9da45382b6f1d150cff8d062b7aaa3"}, - {file = "termcolor-2.0.1.tar.gz", hash = "sha256:6b2cf769e93364a2676e1de56a7c0cff2cf5bd07f37e9cc80b0dd6320ebfe388"}, + {file = "termcolor-2.4.0-py3-none-any.whl", hash = "sha256:9297c0df9c99445c2412e832e882a7884038a25617c60cea2ad69488d4040d63"}, + {file = "termcolor-2.4.0.tar.gz", hash = "sha256:aab9e56047c8ac41ed798fa36d892a37aca6b3e9159f3e0c24bc64a9b3ac7b7a"}, ] [package.extras] @@ -2351,4 +2351,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8.0" -content-hash = "10aa4808e56fd71b438e074ae1a328290ec06b6e3e674b6cdc7e8bcf7eb9646e" +content-hash = "efb6d4c73ebbe66037c11460f7323fdb8df3a07d2df07908a40ceea3dd833416" diff --git a/pyproject.toml b/pyproject.toml index d82710411..4b8d69327 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,17 +34,17 @@ nxcdb = 'nxc.nxcdb:main' [tool.poetry.dependencies] python = "^3.8.0" -aardwolf = "^0.2.7" +aardwolf = "^0.2.8" aioconsole = "^0.6.2" aiosqlite = "^0.19.0" argcomplete = "^3.1.4" -asyauth = "~0.0.14" +asyauth = ">=0.0.20" beautifulsoup4 = ">=4.11,<5" -bloodhound = "^1.6.1" -dploot = "^2.2.1" +bloodhound = "^1.7.2" +dploot = "^2.7.1" dsinternals = "^1.2.4" impacket = { git = "https://github.com/fortra/impacket.git" } -lsassy = ">=3.1.8" +lsassy = ">=3.1.10" masky = "^0.2.0" minikerberos = "^0.4.1" msgpack = "^1.0.0" @@ -61,7 +61,7 @@ python-libnmap = "^0.7.3" requests = ">=2.27.1" rich = "^13.3.5" sqlalchemy = "^2.0.4" -termcolor = "2.0.1" +termcolor = ">=2.4.0" terminaltables = "^3.1.0" xmltodict = "^0.13.0" From bc4416d567a0ee43b0d26bccd9bedcc626210c4a Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Sat, 20 Apr 2024 20:03:22 -0400 Subject: [PATCH 3/5] Change CRLF to LF to match all other files --- pyproject.toml | 262 ++++++++++++++++++++++++------------------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4b8d69327..b1ba4aaf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,131 +1,131 @@ -[tool.poetry] -name = "netexec" -version = "1.1.0" -description = "The Network Execution tool" -authors = [ - "Marshall Hallenbeck ", - "Alexander Neff ", - "Thomas Seigneuret " -] -readme = "README.md" -homepage = "https://github.com/Pennyw0rth/NetExec" -repository = "https://github.com/Pennyw0rth/NetExec" -exclude = [] -include = [ - "nxc/data/*", - "nxc/modules/*" -] -license = "BSD-2-Clause" -classifiers = [ - 'Environment :: Console', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 3', - 'Topic :: Security', -] -packages = [ - { include = "nxc"} -] - -[tool.poetry.scripts] -nxc = 'nxc.netexec:main' -netexec = 'nxc.netexec:main' -NetExec = 'nxc.netexec:main' -nxcdb = 'nxc.nxcdb:main' - -[tool.poetry.dependencies] -python = "^3.8.0" -aardwolf = "^0.2.8" -aioconsole = "^0.6.2" -aiosqlite = "^0.19.0" -argcomplete = "^3.1.4" -asyauth = ">=0.0.20" -beautifulsoup4 = ">=4.11,<5" -bloodhound = "^1.7.2" -dploot = "^2.7.1" -dsinternals = "^1.2.4" -impacket = { git = "https://github.com/fortra/impacket.git" } -lsassy = ">=3.1.10" -masky = "^0.2.0" -minikerberos = "^0.4.1" -msgpack = "^1.0.0" -neo4j = "^5.0.0" -paramiko = "^3.3.1" -poetry-dynamic-versioning = "^1.2.0" -pyasn1-modules = "^0.3.0" -pylnk3 = "^0.4.2" -pypsrp = "^0.8.1" -pypykatz = "^0.6.8" -pywerview = "^0.3.3" # pywerview 5 requires libkrb5-dev installed which is not default on kali (as of 9/23) -python-dateutil = ">=2.8.2" -python-libnmap = "^0.7.3" -requests = ">=2.27.1" -rich = "^13.3.5" -sqlalchemy = "^2.0.4" -termcolor = ">=2.4.0" -terminaltables = "^3.1.0" -xmltodict = "^0.13.0" - -[tool.poetry.group.dev.dependencies] -flake8 = "*" -shiv = "*" -pytest = "^7.2.2" -ruff = "=0.0.292" - -[build-system] -requires = ["poetry-core>=1.2.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] -build-backend = "poetry_dynamic_versioning.backend" - -[tool.poetry-dynamic-versioning] -enable = true -pattern = "(?P\\d+\\.\\d+\\.\\d+)" -format = "{base}+{commit}" - -[tool.ruff] -# Ruff doesn't enable pycodestyle warnings (`W`) or -# McCabe complexity (`C901`) by default. -# Other options: pep8-naming (N), flake8-annotations (ANN), flake8-blind-except (BLE), flake8-commas (COM), flake8-pyi (PYI), flake8-pytest-style (PT), flake8-unused-arguments (ARG), etc -# Should tackle flake8-use-pathlib (PTH) at some point -select = ["E", "F", "D", "UP", "YTT", "ASYNC", "B", "A", "C4", "ISC", "ICN", "PIE", "PT", "Q", "RSE", "RET", "SIM", "TID", "ERA", "FLY", "PERF", "FURB", "LOG", "RUF"] -ignore = [ "E501", "F405", "D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", "D203", "D204", "D205", "D212", "D213", "D400", "D401", "D415", "D417", "D419", "RET503", "RET505", "RET506", "RET507", "RET508", "PERF203", "RUF012"] - -# Allow autofix for all enabled rules (when `--fix`) is provided. -fixable = ["ALL"] -unfixable = [] - -# Exclude a variety of commonly ignored directories. -exclude = [ - ".bzr", - ".direnv", - ".eggs", - ".git", - ".git-rewrite", - ".hg", - ".mypy_cache", - ".nox", - ".pants.d", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "venv", -] -per-file-ignores = {} - -line-length = 65000 - -# Allow unused variables when underscore-prefixed. -dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" - -target-version = "py37" - -[tool.ruff.flake8-quotes] -docstring-quotes = "double" -inline-quotes = "double" -multiline-quotes = "double" +[tool.poetry] +name = "netexec" +version = "1.1.0" +description = "The Network Execution tool" +authors = [ + "Marshall Hallenbeck ", + "Alexander Neff ", + "Thomas Seigneuret " +] +readme = "README.md" +homepage = "https://github.com/Pennyw0rth/NetExec" +repository = "https://github.com/Pennyw0rth/NetExec" +exclude = [] +include = [ + "nxc/data/*", + "nxc/modules/*" +] +license = "BSD-2-Clause" +classifiers = [ + 'Environment :: Console', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Python :: 3', + 'Topic :: Security', +] +packages = [ + { include = "nxc"} +] + +[tool.poetry.scripts] +nxc = 'nxc.netexec:main' +netexec = 'nxc.netexec:main' +NetExec = 'nxc.netexec:main' +nxcdb = 'nxc.nxcdb:main' + +[tool.poetry.dependencies] +python = "^3.8.0" +aardwolf = "^0.2.8" +aioconsole = "^0.6.2" +aiosqlite = "^0.19.0" +argcomplete = "^3.1.4" +asyauth = ">=0.0.20" +beautifulsoup4 = ">=4.11,<5" +bloodhound = "^1.7.2" +dploot = "^2.7.1" +dsinternals = "^1.2.4" +impacket = { git = "https://github.com/fortra/impacket.git" } +lsassy = ">=3.1.10" +masky = "^0.2.0" +minikerberos = "^0.4.1" +msgpack = "^1.0.0" +neo4j = "^5.0.0" +paramiko = "^3.3.1" +poetry-dynamic-versioning = "^1.2.0" +pyasn1-modules = "^0.3.0" +pylnk3 = "^0.4.2" +pypsrp = "^0.8.1" +pypykatz = "^0.6.8" +pywerview = "^0.3.3" # pywerview 5 requires libkrb5-dev installed which is not default on kali (as of 9/23) +python-dateutil = ">=2.8.2" +python-libnmap = "^0.7.3" +requests = ">=2.27.1" +rich = "^13.3.5" +sqlalchemy = "^2.0.4" +termcolor = ">=2.4.0" +terminaltables = "^3.1.0" +xmltodict = "^0.13.0" + +[tool.poetry.group.dev.dependencies] +flake8 = "*" +shiv = "*" +pytest = "^7.2.2" +ruff = "=0.0.292" + +[build-system] +requires = ["poetry-core>=1.2.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" + +[tool.poetry-dynamic-versioning] +enable = true +pattern = "(?P\\d+\\.\\d+\\.\\d+)" +format = "{base}+{commit}" + +[tool.ruff] +# Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +# Other options: pep8-naming (N), flake8-annotations (ANN), flake8-blind-except (BLE), flake8-commas (COM), flake8-pyi (PYI), flake8-pytest-style (PT), flake8-unused-arguments (ARG), etc +# Should tackle flake8-use-pathlib (PTH) at some point +select = ["E", "F", "D", "UP", "YTT", "ASYNC", "B", "A", "C4", "ISC", "ICN", "PIE", "PT", "Q", "RSE", "RET", "SIM", "TID", "ERA", "FLY", "PERF", "FURB", "LOG", "RUF"] +ignore = [ "E501", "F405", "D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", "D203", "D204", "D205", "D212", "D213", "D400", "D401", "D415", "D417", "D419", "RET503", "RET505", "RET506", "RET507", "RET508", "PERF203", "RUF012"] + +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", +] +per-file-ignores = {} + +line-length = 65000 + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +target-version = "py37" + +[tool.ruff.flake8-quotes] +docstring-quotes = "double" +inline-quotes = "double" +multiline-quotes = "double" From 18c3fd0b306903f1fa1e1144a396fa402a236a68 Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Tue, 23 Apr 2024 18:16:10 -0400 Subject: [PATCH 4/5] Add msldap to fix #274 --- poetry.lock | 8 ++++---- pyproject.toml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index d50b65a9a..68a05083a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1299,13 +1299,13 @@ files = [ [[package]] name = "msldap" -version = "0.5.9" +version = "0.5.10" description = "Python library to play with MS LDAP" optional = false python-versions = ">=3.7" files = [ - {file = "msldap-0.5.9-py3-none-any.whl", hash = "sha256:26c0418086f788c1197341ee31d4ffbc69c057aef339cd91e882ca7c1fb10fcb"}, - {file = "msldap-0.5.9.tar.gz", hash = "sha256:5f3c4e362296e0e1eba447eda9f230988a7b2a08826f7b3ed34ec9612ebcfe33"}, + {file = "msldap-0.5.10-py3-none-any.whl", hash = "sha256:263a4bfa832f3b9f27163e5a752151608283745dba22ad8d7c560ae18e0e193b"}, + {file = "msldap-0.5.10.tar.gz", hash = "sha256:65bfe0e502c94d26f45d366f567cdb62462f27f655bd0ae2f0228fe3c9f989b8"}, ] [package.dependencies] @@ -2351,4 +2351,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8.0" -content-hash = "efb6d4c73ebbe66037c11460f7323fdb8df3a07d2df07908a40ceea3dd833416" +content-hash = "17488cfeacedee4367d181583c0f1e3ba0511f0ae37013cb1b65267c44722586" diff --git a/pyproject.toml b/pyproject.toml index b1ba4aaf5..4ac1bed00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ lsassy = ">=3.1.10" masky = "^0.2.0" minikerberos = "^0.4.1" msgpack = "^1.0.0" +msldap = "^0.5.10" neo4j = "^5.0.0" paramiko = "^3.3.1" poetry-dynamic-versioning = "^1.2.0" From ab5966f8d93b1d085282814dbdaef0f890b936fd Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Sat, 27 Apr 2024 18:38:44 -0400 Subject: [PATCH 5/5] Fix lint error --- nxc/modules/daclread.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nxc/modules/daclread.py b/nxc/modules/daclread.py index 01e8213ca..2cb4f45cd 100644 --- a/nxc/modules/daclread.py +++ b/nxc/modules/daclread.py @@ -221,7 +221,6 @@ def options(self, context, module_options): Based on the work of @_nwodtuhs and @BlWasp_. """ - context.log.debug(f"module_options: {module_options}") if not module_options: