Skip to content

Commit b5ae287

Browse files
author
Brent Cook
committed
ensure that default_name, dns_host_name, and dns_domain_name are set
1 parent 245237d commit b5ae287

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/rex/proto/smb/client.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ def session_setup_with_ntlmssp(user = '', pass = '', domain = '', name = nil, do
840840
flags: ntlmssp_flags
841841
)
842842

843-
844843
blob = @ntlm_client.init_context.serialize
845844

846845
native_data = ''
@@ -901,6 +900,14 @@ def session_setup_with_ntlmssp(user = '', pass = '', domain = '', name = nil, do
901900
# Save the temporary UserID for use in the next request
902901
temp_user_id = ack['Payload']['SMB'].v['UserID']
903902

903+
blob_data = NTLM_UTILS.parse_ntlm_type_2_blob(blob)
904+
#netbios name
905+
self.default_name = blob_data[:default_name] || ''
906+
#dns name
907+
self.dns_host_name = blob_data[:dns_host_name] || ''
908+
#dns domain
909+
self.dns_domain_name = blob_data[:dns_domain_name] || ''
910+
904911
type3 = @ntlm_client.init_context([blob].pack('m'))
905912
type3_blob = type3.serialize
906913
self.signing_key = @ntlm_client.session_key

0 commit comments

Comments
 (0)