Skip to content

[MSSQL] rid_brute crashes with AttributeError when SUSER_SNAME returns NULL (SQL login) #1533

Closed as duplicate

Description

@JordaoMbambu

Describe the bug

When running --rid-brute against an MSSQL target using a SQL login (not a Windows/domain account), NetExec crashes with AttributeError: 'NoneType' object has no attribute 'split' at mssql.py:480.

This happens because SUSER_SNAME() returns NULL for RIDs that don't resolve to a name, and the code tries to call .split("\\") on that None value without a null check.

To Reproduce

Command:

nxc mssql 10.129.101.239 --local-auth -u SQLGuest -p 'zDPBpaF4FywlqIv11vii' --rid-brute 5000

Resulted in:

verbose_error
MSSQL  10.129.101.239  1433  DC  [+] DC\SQLGuest:zDPBpaF4FywlqIv11vii
MSSQL  10.129.101.239  1433  DC  0: None
[ERROR] Exception while calling proto_flow() on target 10.129.101.239: 'NoneType' object has no attribute 'split'
  File "nxc/protocols/mssql.py", line 480, in rid_brute
    "username": username.split("\\")[1],
AttributeError: 'NoneType' object has no attribute 'split'

Expected behavior

RIDs that return NULL from SUSER_SNAME() should be silently skipped and the brute force should continue to the next RID.

After the fix, unresolved RIDs are skipped and displayed as None without crashing:

None

Proposed fix

In nxc/protocols/mssql.py line 480:

# Before
"username": username.split("\\")[1],

# After
"username": username.split("\\")[1] if username and "\\" in username else username,
before_after_changing

After applying the fix, --rid-brute works correctly and enumerates domain users:

rid_brute_working

NetExec info

  • OS: Exegol
  • Version of nxc: 0.0.0 - Yippie-Ki-Yay - f6b0896 - 1 (dev build from GitHub)
  • Installed from: pipx (GitHub source)

Activity

  1. NeffIsBack commented on Nov 17, 2026

    @NeffIsBack
    Member

    Thanks for the bug report! Feel free to open up a PR if you have the time :)

  2. added theissue type on Nov 17, 2026
  3. JordaoMbambu commented on Nov 17, 2026

    @JordaoMbambu
    Author

    Thanks for the bug report! Feel free to open up a PR if you have the time :)

    Done! Already opened a PR with the fix :)

  4. NeffIsBack commented on Nov 18, 2026

    @NeffIsBack
    Member

    Closing as duplicate, see #1534 (comment)

  5. JordaoMbambu commented on Nov 18, 2026

    @JordaoMbambu
    Author

    Thanks @NeffIsBack, I explained what happened on the PR (#1534)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions