Skip to content

Commit

Permalink
Always negate the flag rather than xor it
Browse files Browse the repository at this point in the history
  • Loading branch information
Meatballs1 committed Oct 12, 2018
1 parent ff8c58e commit f9add29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion impacket/examples/ntlmrelayx/clients/ldaprelayclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from impacket.examples.ntlmrelayx.clients import ProtocolClient
from impacket.nt_errors import STATUS_SUCCESS, STATUS_ACCESS_DENIED
from impacket.ntlm import NTLMAuthChallenge, NTLMAuthNegotiate, NTLMSSP_NEGOTIATE_SIGN
from impacket.ntlm import NTLMAuthChallenge, NTLMAuthNegotiate, NTLMSSP_NEGOTIATE_SIGN, NTLMSSP_NEGOTIATE_ALWAYS_SIGN
from impacket.spnego import SPNEGO_NegTokenResp

PROTOCOL_CLIENT_CLASSES = ["LDAPRelayClient", "LDAPSRelayClient"]
Expand Down Expand Up @@ -65,6 +65,9 @@ def sendNegotiate(self, negotiateMessage):
negoMessage = NTLMAuthNegotiate()
negoMessage.fromString(negotiateMessage)
negoMessage['flags'] &= ~NTLMSSP_NEGOTIATE_SIGN
# We shouldn't need to set this, as ALWAYS_SIGN is overridden by
# NEGOTIATE_SIGN. However included for clarity.
negoMessage['flags'] &= ~NTLMSSP_NEGOTIATE_ALWAYS_SIGN
self.negotiateMessage = str(negoMessage)

with self.session.connection_lock:
Expand Down

0 comments on commit f9add29

Please sign in to comment.