From b5ae2872356e386d4c2867611af2c19cfc3b3a8d Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 13 Sep 2016 18:32:59 -0500 Subject: [PATCH] ensure that default_name, dns_host_name, and dns_domain_name are set --- lib/rex/proto/smb/client.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/rex/proto/smb/client.rb b/lib/rex/proto/smb/client.rb index d2affbd5bc..c9ab9d3db4 100644 --- a/lib/rex/proto/smb/client.rb +++ b/lib/rex/proto/smb/client.rb @@ -840,7 +840,6 @@ NTLM_UTILS = Rex::Proto::NTLM::Utils flags: ntlmssp_flags ) - blob = @ntlm_client.init_context.serialize native_data = '' @@ -901,6 +900,14 @@ NTLM_UTILS = Rex::Proto::NTLM::Utils # Save the temporary UserID for use in the next request temp_user_id = ack['Payload']['SMB'].v['UserID'] + blob_data = NTLM_UTILS.parse_ntlm_type_2_blob(blob) + #netbios name + self.default_name = blob_data[:default_name] || '' + #dns name + self.dns_host_name = blob_data[:dns_host_name] || '' + #dns domain + self.dns_domain_name = blob_data[:dns_domain_name] || '' + type3 = @ntlm_client.init_context([blob].pack('m')) type3_blob = type3.serialize self.signing_key = @ntlm_client.session_key