Marshall Hallenbeck 6409e0d684 fix(moduleloader): isolate module namespaces and cache loaded modules
The module loader used the same module name "NXCModule" for every file
via spec_from_file_location(), causing sys.modules namespace collisions
when multiple modules are loaded together (-M mod1 -M mod2). Each
subsequent module overwrites the NXCModule class in the shared namespace,
so modules loaded earlier resolve a different class than their own.

This is the underlying mechanism behind multi-module ordering bugs
reported in #879, #880, and #882.

Changes:
- Use unique module names (nxc_module_<filename>) and the modern
  module_from_spec() + exec_module() API instead of the deprecated
  load_module() to give each module its own isolated namespace
- Cache loaded modules so each file is only parsed and executed once,
  regardless of how many targets are scanned (~60x faster than
  re-loading per target)
- Extract shared loading logic into load_module_file() classmethod

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 12:28:10 -05:00
2025-12-30 18:25:24 +08:00
2023-09-28 14:04:34 -04:00
2023-09-28 00:42:54 +02:00
2025-06-14 06:54:26 +00:00
2025-01-06 07:45:59 -05:00
2025-12-26 09:45:25 -05:00
2025-12-03 04:03:51 -05:00
2025-11-15 08:20:14 -05:00
2022-04-29 16:36:28 +00:00

Supported Python versions Twitter Twitter Twitter Twitter

🚩 This is the open source repository of NetExec maintained by a community of passionate people

NetExec - The Network Execution Tool

This project was initially created in 2015 by @byt3bl33d3r, known as CrackMapExec. In 2019 @mpgn_x64 started maintaining the project for the next 4 years, adding a lot of great tools and features. In September 2023 he retired from maintaining the project.

Along with many other contributors, we (NeffIsBack, Marshall-Hallenbeck, and zblurx) developed new features, bug fixes, and helped maintain the original project CrackMapExec. During this time, with both a private and public repository, community contributions were not easily merged into the project. The 6-8 month discrepancy between the code bases caused many development issues and heavily reduced community-driven development. With the end of mpgn's maintainer role, we (the remaining most active contributors) decided to maintain the project together as a fully free and open source project under the new name NetExec 🚀 Going forward, our intent is to maintain a community-driven and maintained project with regular updates for everyone to use.

You are on the latest up-to-date repository of the project NetExec (nxc) ! 🎉

  • 🚧 If you want to report a problem, open an Issue
  • 🔀 If you want to contribute, open a Pull Request
  • 💬 If you want to discuss, open a Discussion

Official Discord Channel

If you don't have a Github account, you can ask your questions on Discord!

NetExec

Documentation, Tutorials, Examples

See the project's wiki (in development) for documentation and usage examples

Installation

Please see the installation instructions on the wiki (in development)

Linux

sudo apt install pipx git
pipx ensurepath
pipx install git+https://github.com/Pennyw0rth/NetExec

Availability on Unix distributions

Packaging status

Development

Development guidelines and recommendations in development

Acknowledgments

All the hard work and development over the years from everyone in the CrackMapExec project

Code Contributors

Awesome code contributors of NetExec:

S
Description
Automated archival mirror of github.com/Pennyw0rth/NetExec
Readme BSD-2-Clause 43 MiB
Languages
Python 99.1%
PowerShell 0.6%
VBScript 0.2%