Post

Information Disclosure in NTLM Authentication

A null NTLM Type 1 message can coerce many Windows services into returning NetBIOS, DNS, and OS build info.

This post introduces the concept of information disclosure through NTLM authentication and demonstrates methods for invoking an NTLM challenge response over HTTP(S) - even when no login page is present.

TL;DR

  • A null Type 1 message gets many Windows services to return a Type 2 challenge with NetBIOS, DNS, and product version fields.
  • Over HTTP, Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA= forces that challenge even when there’s no login prompt.
  • Nmap’s *-ntlm-info scripts check HTTP, SMTP, IMAP, POP3, RDP, MS-SQL, NNTP, and Telnet in one pass.
  • Useful for recon, but thin as a standalone finding these days.

What the challenge leaks

The Type 2 response carries these fields:

1
2
3
4
5
6
7
Target_Name: DEMO
NetBIOS_Domain_Name: DEMO
NetBIOS_Computer_Name: SRV01
DNS_Domain_Name: demo.local
DNS_Computer_Name: srv01.demo.local
DNS_Tree_Name: demo.local
Product_Version: 6.3.9600

On an engagement these are worth three things: internal naming conventions, DNS suffixes to aim at OWA and other auth endpoints, and product versions that flag end-of-life hosts.

OWA login. The DNS suffix from a Type 2 challenge often matches the username format needed for a spray.

Pulling it over HTTP

If the site already shows a Windows auth prompt, blank credentials are enough. If it doesn’t, add this header to a request against a path that accepts Windows authentication:

1
Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=

HTTP request with a Type 1 NTLM Authorization header.

A WWW-Authenticate response carrying another TlRMTVNTUAAC… blob is the Type 2 challenge. Decode it with Burp’s NTLM Challenge Decoder, or any of the scripts that do the same job.

Decoded Type 2 fields from the WWW-Authenticate header.

Same leak on other protocols

HTTP is the obvious place. The same Type 1 blob works anywhere the service speaks NTLM, including POP3, RDP, MS-SQL, NNTP, and Telnet.

Lab notes: SMTP and IMAP over Telnet

SMTP on submission (587):

1
2
3
4
5
6
7
8
9
10
11
telnet example.com 587
220 example.com SMTP Server Banner

>> HELO
250 example.com Hello [x.x.x.x]

>> AUTH NTLM
334 NTLM supported

>> TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=
334 TlRMTVNTUAACAAAACgAKADgAAAAFgooCBqqVKFrKPCMAAAAAAAAAAEgASABCAAAABgOAJQAAAA9JAEkAUwAwADEAAgAKAEkASQBTADAAMQABAAoASQBJAFMAMAAxAAQACgBJAEkAUwAwADEAAwAKAEkASQBTADAAMQAHAAgAHwMI0VPy1QEAAAAA

IMAP:

1
2
3
4
5
6
7
8
telnet example.com 143
* OK The Microsoft Exchange IMAP4 service is ready.

>> a1 AUTHENTICATE NTLM
+

>> TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=
+ TlRMTVNTUAACAAAACgAKADgAAAAFgooCBqqVKFrKPCMAAAAAAAAAAEgASABCAAAABgOAJQAAAA9JAEkAUwAwADEAAgAKAEkASQBTADAAMQABAAoASQBJAFMAMAAxAAQACgBJAEkAUwAwADEAAwAKAEkASQBTADAAMQAHAAgAHwMI0VPy1QEAAAAA

Checking it with Nmap

Nmap ships NSE scripts for most of those services. One pass against open ports:

1
nmap -sS -v --script=*-ntlm-info --script-timeout=60s example.com
1
2
3
4
5
6
7
8
9
PORT     STATE SERVICE
80/tcp   open  http
| http-ntlm-info:
|   Target_Name: IIS01
|   NetBIOS_Domain_Name: IIS01
|   NetBIOS_Computer_Name: IIS01
|   DNS_Domain_Name: IIS01
|   DNS_Computer_Name: IIS01
|_  Product_Version: 6.3.9600

Takeaway

When a service answers a Type 1 with a Type 2 challenge, grab the names and keep going — sprays, host mapping, EOL builds. On its own it’s recon, not a finding worth writing up.

If NTLM over HTTP isn’t needed, turn it off in IIS. Keeping Windows-auth services off the public internet closes the leak and shrinks the brute-force surface.

References