Repository navigation
v1.2.6
What's Changed
Bug Fixes - SPNEGO / Authentication Layer spnego.py, mock_server.py
-
!spnego -
NoneResponseToken in Type 2 challenge causes auth failure (impacket compatibility break): When PwnRM negotiated NTLM through SPNEGO against a server whose SPNEGO stack was assembled via impacket's pyasn1 binding,NegTokenResp["ResponseToken"]returnedNonerather than the raw NTLM Type 2 bytes. This occurred because impacket'sSPNEGO_NegTokenResponly populates the field when the internal pyasn1 component path is written through the correct accessor — which differs between impacket versions — leaving the field unset despite the bytes being present in the DER envelope. Downstream,NTLMAuthChallenge(type2)receivedNone, producing an immediateTypeErrorand aborting the handshake. Fixed inspnego.py:64-71by scanning the rawdata_inbuffer for theNTLMSSP\x00signature whenResponseTokenisNone, extracting the challenge directly from the blob, and raisingSPNEGOError("SPNEGO: missing ResponseToken in Type 2 challenge")only if the signature is absent entirely. -
!mock_server - Fixed offset NTLM token detection breaks SPNEGO-wrapped NegTokenInit from impacket: The mock server's auth dispatch used a hardcoded
token[8:12]byte slice to identify NTLM message type, assuming tokens always arrive as raw NTLMSSP. When Linux impacket sends a SPNEGO-wrappedNegTokenInit, the NTLMSSP signature appears at a variable offset inside the ASN.1 envelope —token[8:12]reads the wrong bytes, the type check falls through, and the server rejects valid negotiation tokens. Simultaneously, the originalNTLM_CHALLENGEwas a hand-rolled byte stub that did not conform to MS-NLMP §2.2.1.2 — missing proper TargetInfo AV_PAIRS, a valid server challenge value, and a well-formed Version field — causing impacket's strict ASN.1 parser to reject the challenge during the mock test cycle. Fixed inmock_server.py:218-232by replacing the fixed-offset slice withtoken.find(b"NTLMSSP\x00")for signature detection, computingmsg_typerelative tosig_pos, and inserting a bare-SPNEGO fast path that issues a challenge and returns immediately when no NTLMSSP signature is found.NTLM_CHALLENGEwas rebuilt via_build_ntlm_type2()(conforming to MS-NLMP §2.2.1.2 withMsvAvNbDomainName+MsvAvEOLAV_PAIRS and a non-zeroServerChallenge) and wrapped in a fully hand-rolled DER SPNEGONegTokenRespvia_build_spnego_challenge()(RFC 4178 §4.2.2) to avoid impacket version-dependent field-assignment behavior. Affectedmock_server.py:49-110, 218-248.
Housekeeping
- Security advisory added to
HALL_OF_FAME.md, crediting @fuzt3r for new bug advisory - GHSA-xhjp-r3m9-54vj!
Full Changelog: v1.2.5...v1.2.6