Users-export flag does not honor active-users flag

Open
#1,458 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@H1DroZz is already working on this.

Since Feb 9, 2026.

  • #1101 by @H1DroZz — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
32/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start with the methods users_export() and users(), which the issue says share one file write, and with active_users(), which has no export logic. Run the reproduction command with both flags and compare the export file against the active-user list. Done means the export holds only active accounts (9 of 14 in the report). Linked PR #1101 is already open, so check it before starting.

Written by the indexing model from the issue text.

Description

Describe the bug
Using --active-users together with --users-export writes every domain user to the export file, not just the active ones. The --active-users filter has no effect on the export.

To Reproduce
Command: nxc ldap 10.10.1.10 -u jdoe -p 'Summer2026!' --active-users --users-export /tmp/actually-all-users.txt
Resulted in:

LDAP        10.10.1.10      389    DC01             [*] Windows Server 2022 Build 20348 (name:DC01) (domain:lab.local) (signing:None) (channel binding:No TLS cert)
LDAP        10.10.1.10      389    DC01             [+] lab.local\jdoe:Summer2026!
LDAP        10.10.1.10      389    DC01             [*] Enumerated 14 domain users: lab.local
LDAP        10.10.1.10      389    DC01             -Username-                    -Last PW Set-       -BadPW-  -Description-
LDAP        10.10.1.10      389    DC01             labadmin                      2026-10-08 19:13:20 0        Built-in account for administering the computer/domain
[...]
LDAP        10.10.1.10      389    DC01             disableduser                  2026-10-08 20:02:12 0        Disabled account (CLIENT_REVOKED)
[...]
LDAP        10.10.1.10      389    DC01             [*] Writing 14 local users to /tmp/actually-all-users.txt
LDAP        10.10.1.10      389    DC01             [*] Total records returned: 14, total 5 user(s) disabled
[...]
wc -l /tmp/actually-all-users.txt
14 /tmp/actually-all-users.txt

The file includes disabled accounts (Guest, krbtgt, disableduser) even though --active-users is set.

Expected behavior
The export file should contain only the users --active-users reports as active — 9 of the 14, not all 14.

NetExec info

  • OS: Kali Linux
  • Version of nxc: 1.5.1 - Yippie-Ki-Yay - 306bf295 - 957
  • Installed from: github (pipx install git+https://github.com/Pennyw0rth/NetExec)

Additional context
users_export() just calls users(), which writes every enumerated user regardless of the active filter, and active_users() has no export logic of its own. With both flags set, both methods run against the same file.

I have a fix on my fork: https://github.com/its-ryans-work/NetExec/tree/fix/ldap-active-users-export. Happy to do another round of QC and open a PR if this issue is accepted.

AI disclosure: I used Claude Code (Claude Opus 4.8, Opus 5.5, Sonnet 5) to trace the root cause and draft the fix; I reproduced and verified the bug as well as the fix myself in my own lab (output sampled above).

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.