dploot.triage.cng missing from hiddenimports in netexec.spec causes SMB protocol to fail in compiled binary

Open Beginner friendly
#1,198 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
build-system

Research direction

The missing module is imported at line 66 of nxc/protocols/smb.py, and the hiddenimports list in netexec.spec is where the dploot.triage.* entries live. Read that list to see which submodules are already present, then rebuild with PyInstaller and run the SMB protocol import to confirm the ModuleNotFoundError is gone. Done means the compiled binary loads the SMB module and nxc smb HOST -u USER -p PASS --users runs without that error.

Written by the indexing model from the issue text.

Description

dependencies

Describe the bug
When building NetExec from source using PyInstaller, the compiled binary fails to load the SMB protocol due to a missing dploot.triage.cng submodule, even though other dploot.triage.* submodules are already listed in hiddenimports in netexec.spec.

To Reproduce
Command: nxc smb HOST -u USER -p PASS --users

Resulted in:

Traceback (most recent call last):
  File "netexec.py"
  File "nxc/protocols/smb.py", line 66, in <module>
    from dploot.triage.cng import CngTriage
ModuleNotFoundError: No module named 'dploot.triage.cng'
[PYI-194271:ERROR] Failed to execute script 'netexec' due to unhandled exception!

Expected behavior
SMB protocol loads successfully without import errors.

Root Cause
dploot.triage.cng is imported in smb.py but missing from hiddenimports in netexec.spec. Other dploot.triage.* submodules are already listed, but cng was not included.

Fix
Add 'dploot.triage.cng' to the hiddenimports list in netexec.spec:

'dploot',
'dploot.triage',
'dploot.triage.cng',
'dploot.triage.rdg',
.....

Suggested long-term fix
Replace manual submodule entries with collect_all in netexec.spec to avoid recurring issues as new submodules are added:

from PyInstaller.utils.hooks import collect_all
dploot_datas, dploot_binaries, dploot_hiddenimports = collect_all("dploot")

NetExec info

  • OS: Kali Linux
  • Version of nxc: 1.5.1 - Yippie-Ki-Yay - af454118 - 273
  • Installed from: GitHub source, built manually with PyInstaller 6.19.0
  • Python: 3.12.3
Dominant language
Python
Stars
6k
Forks
803
Avg merge
2d 13h
Merged PRs (30d)
23

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Pennyw0rth/NetExec

All issues in Pennyw0rth/NetExec

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.