Skip to content

Fix windows ntlmv2 signing#1

Open
matteoguarnaccia wants to merge 2 commits into
drudge:mainfrom
matteoguarnaccia:fix-windows-ntlmv2-signing
Open

Fix windows ntlmv2 signing#1
matteoguarnaccia wants to merge 2 commits into
drudge:mainfrom
matteoguarnaccia:fix-windows-ntlmv2-signing

Conversation

@matteoguarnaccia

Copy link
Copy Markdown

Summary

Fixes Windows share authentication/connectivity with modern SMB servers.

Problem

  • NTLMv2 challenge fields were not fully reused when building the Type 3 message.
  • The client advertised unsupported NTLM Version data.
  • Some SMB2 servers accept authentication but reject TREE_CONNECT with STATUS_ACCESS_DENIED when SMB2 signing is required.
  • TREE_CONNECT included the port in the UNC path.

Changes

  • Parse NTLM Type 2 challenge flags, target info, and server challenge.
  • Build the NTLMv2 response using the server-provided target info.
  • Derive the NTLMv2 session base key.
  • Sign authenticated SMB2 requests with HMAC-SHA256.
  • Send TREE_CONNECT path as \\host\share.
  • Pin @types/node to a TypeScript 4-compatible Node 18 version so the project builds reliably.

Validation

Tested against a Windows SMB share with:

  • NTLMv2 authentication
  • SMB2 TREE_CONNECT
  • readDirectory("/")

Build validation:

  • npm.cmd run build

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant