You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The modules/auxiliary/scanner/http/ntlm_info_enumeration.rb module already contains some parsing:
vprint_status("Status: #{res.code}")ifres && res.code == 401 && res['WWW-Authenticate'] && res['WWW-Authenticate'].match(/^NTLM/i)hash=res['WWW-Authenticate'].split('NTLM ')[1]# Parse out the NTLM and just get the Target Information Datatarget=Rex::Proto::NTLM::Message.parse(Rex::Text.decode_base64(hash))[:target_info].value()# Retrieve Domain name subblock infonb_domain=parse_ntlm_info(target,"\x02\x00",0)# Retrieve Server name subblock infonb_name=parse_ntlm_info(target,"\x01\x00",nb_domain[:new_offset])# Retrieve DNS domain name subblock infodns_domain=parse_ntlm_info(target,"\x04\x00",nb_name[:new_offset])# Retrieve DNS server name subblock infodns_server=parse_ntlm_info(target,"\x03\x00",dns_domain[:new_offset])return{:nb_name=>nb_name[:message],:nb_domain=>nb_domain[:message],:dns_domain=>dns_domain[:message],:dns_server=>dns_server[:message]}endenddefparse_ntlm_info(message,pattern,offset)name_index=message.index(pattern,offset)offset=name_index.to_isize=message[offset+2].unpack('C').firstreturn{:message=>message[offset+3,size].gsub(/\0/,''),:new_offset=>offset + size}end
Augment auxiliary/scanner/winrm/winrm_auth_methods to also decode and print NTLM domain info in the event that the target supports NTLM authentication.
Here's what looks like an overly complicated example written in Ruby:
Alternatively, take the lazy approach and indiscriminately dump everything. Psuedocode:
The
modules/auxiliary/scanner/http/ntlm_info_enumeration.rb
module already contains some parsing:However, this module does not support WinRM:
The text was updated successfully, but these errors were encountered: