Skip to content

Feature/ntlmsign - #1525

Open
SoftAndoWetto wants to merge 10 commits into
Pennyw0rth:mainfrom
SoftAndoWetto:feature/ntlmsign
Open

SoftAndoWetto wants to merge 10 commits into
Pennyw0rth:mainfrom
SoftAndoWetto:feature/ntlmsign

Conversation

@SoftAndoWetto

Copy link
Copy Markdown
Contributor

Description

Created a module for checking whether a server has NTLM Signing enforced.

LDAP:

2 NTLM sicily binds are performed

  • The first with NTLMSSP_NEGOTIATE_SIGN set
  • The second without it set

SMB:

  • If the server uses SMBv1 it exits out (Since its not supported)
  • Does 2 full NTLM logins, with and without the sign set

Results:

T/F - NTLM Signing is enforced, must succeed before the second is sent
T/T - NTLM Signing is not enforced
F/. - Unknown

Skipped for Kerberos, Schannel or when NTLM is disabled

AI Assistance

Model: Claude Sonnet 5.5

Note that if you have used AI, you:

  • MUST test the changes against a live system
  • MUST include a screenshot of such a test (e.g. with a before and after screenshot when submitting a bug fix)
  • MUST fill out this PR template by hand, see the project's AI policy: AI_POLICY.md

Type of change

Insert an "x" inside the brackets for relevant items

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Deprecation of feature or functionality
  • This change requires a documentation update
  • This requires a third party update (such as Impacket, Dploot, lsassy, etc)
  • This PR was created with the assistance of AI (list what type of assistance, tool(s)/model(s) in the description)

Setup guide for the review

Tested against Windows Server 2019 (build 17763) DC, domain enclave.local, with a standard domain user.

  1. Domain controller must have update November 10, 2026 or beyond (KB5135557)
  2. The following Registry
  • Path: 'HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0'
  • Value: ServerRequireNtlmSign (REG_DWORD)
  • 1 - Server rejects unsigned clients with SEC_E_UNSUPPORTED_FUNCTION

Screenshots (if appropriate):

The module with ServerRequireNtlmSign both enabled and disabled (SMB)
{5C027322-74C9-456C-9C7D-19672F2719E5}

The module with ServerRequireNtlmSign both enabled and disabled (LDAP)
{EC98F9BE-070F-47AD-9824-30C9144EA185}

Kerberos exception
{AA0BEA8A-3660-449E-86E1-A35F6DE87CB1}

Schannel exception
{08C588B1-9963-449C-9163-6693AD399E02}

Null Auth exception
{CA0C5699-2ACA-45D9-9291-0D461409FFD1}

Checklist:

  • I have ran Ruff against my changes (poetry: poetry run ruff check ., use --fix to automatically fix what it can)
  • I have added or updated the tests/e2e_commands.txt file if necessary (new modules or features are required to be added to the e2e tests)
  • If reliant on changes of third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects
  • I have linked relevant sources that describes the added technique (blog posts, documentation, etc)
  • I have performed a self-review of my own code (not an AI review)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (PR here: https://github.com/Pennyw0rth/NetExec-Wiki)

This module checks if a target enforces NTLM signing by performing two NTLM authentications, one with signing and one without, and logs the results.

Signed-off-by: SoftAndoWetto <188264635+SoftAndoWetto@users.noreply.github.com>
Signed-off-by: SoftAndoWetto <188264635+SoftAndoWetto@users.noreply.github.com>
Signed-off-by: SoftAndoWetto <188264635+SoftAndoWetto@users.noreply.github.com>
@NeffIsBack

Copy link
Copy Markdown
Member

Thanks for the PR!

Can't we just do a manual NTLM handshake on both SMB and LDAP instead of missusing SMBs "normal" login function? Also why don't we support SMBv1?

Signed-off-by: SoftAndoWetto <188264635+SoftAndoWetto@users.noreply.github.com>
@SoftAndoWetto

Copy link
Copy Markdown
Contributor Author

Hello Neff,

Youre right about the SMB implementation, after looking into it more I understand it is fragile and would make more sense to do the full handshake lol, apologies.
The corrections been made so it now, and it's all been tested however let me know if there are any mistakes in practice as this is still new to me :)

As for the SMBv1 not being supported, SMBv1 doesn't use NTLMSSP, meaning the client cant tell the server that it supports NTLM singing, so I just skipped it if it uses it

Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Comment thread nxc/modules/ntlmsign.py Resolved
Signed-off-by: SoftAndoWetto <188264635+SoftAndoWetto@users.noreply.github.com>
Signed-off-by: SoftAndoWetto <188264635+SoftAndoWetto@users.noreply.github.com>

@SoftAndoWetto SoftAndoWetto left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the comments have now been addressed

@NeffIsBack NeffIsBack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:

image

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants