Skip to content

Commit 11685b7

Browse files
committed
Set the server challenge key
1 parent cfb5621 commit 11685b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rex/proto/smb/client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,6 @@ def session_setup_with_ntlmssp(user = '', pass = '', domain = '', name = nil, do
875875

876876
ack = self.smb_recv_parse(CONST::SMB_COM_SESSION_SETUP_ANDX, true)
877877

878-
879878
# The server doesn't know about NTLM_NEGOTIATE
880879
if (ack['Payload']['SMB'].v['ErrorClass'] == 0x00020002)
881880
return session_setup_no_ntlmssp(user, pass, domain)
@@ -906,6 +905,9 @@ def session_setup_with_ntlmssp(user = '', pass = '', domain = '', name = nil, do
906905
type3_blob = type3.serialize
907906
self.signing_key = @ntlm_client.session_key
908907

908+
# Ugh, it's private
909+
self.challenge_key = @ntlm_client.session.send(:server_challenge)
910+
909911
pkt = CONST::SMB_SETUP_NTLMV2_PKT.make_struct
910912
self.smb_defaults(pkt['Payload']['SMB'])
911913

0 commit comments

Comments
 (0)