From 078496437f60633ca376a0de6d82d9f9c2c5424c Mon Sep 17 00:00:00 2001 From: Brendan Date: Wed, 19 Oct 2016 17:11:04 -0500 Subject: [PATCH] Make sure that the ntlm blob data is pasrsed into UTF-8 --- lib/rex/proto/ntlm/utils.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/rex/proto/ntlm/utils.rb b/lib/rex/proto/ntlm/utils.rb index e61ab03dc4..d1488fc826 100644 --- a/lib/rex/proto/ntlm/utils.rb +++ b/lib/rex/proto/ntlm/utils.rb @@ -402,16 +402,20 @@ class Utils data[:default_name] = temp_name.encode("UTF-8") when 2 #netbios domain - data[:default_domain] = addr - data[:default_domain].force_encoding("UTF-16LE") + temp_domain = addr + temp_domain.force_encoding("UTF-16LE") + data[:default_domain] = temp_domain.encode("UTF-8") when 3 #dns name - data[:dns_host_name] = addr - data[:dns_host_name].force_encoding("UTF-16LE") + temp_dns = addr + temp_dns.force_encoding("UTF-16LE") + data[:dns_host_name] = temp_dns.encode("UTF-8") + when 4 #dns domain - data[:dns_domain_name] = addr - data[:dns_domain_name].force_encoding("UTF-16LE") + temp_dns_domain = addr + temp_dns_domain.force_encoding("UTF-16LE") + data[:dns_domain_name] = temp_dns_domain.encode("UTF-8") when 5 #The FQDN of the forest. when 6