Descobrir hostname windows

De Wiki Hackstore

Para descobrir o hostname de um servidor ou desktop windows:

# nmap -sU --script nbstat.nse -p137 192.168.0.3

A saída deste comando conterá o hostname, no caso DC01:

Starting Nmap 5.51 ( http://nmap.org ) at 2017-10-13 15:05 -03
Nmap scan report for dc01 (192.168.0.3)
Host is up (0.00050s latency).
PORT    STATE SERVICE
137/udp open  netbios-ns
MAC Address: 00:0C:29:4A:98:2C (VMware)

Host script results:
| nbstat: 
|   NetBIOS name: DC01, NetBIOS user: <unknown>, NetBIOS MAC: 00:0c:29:4a:98:2c (VMware)
|   Names
|     DC01<00>             Flags: <unique><active>
|     HACKSTORE<00>        Flags: <group><active>
|     HACKSTORE<1c>        Flags: <group><active>
|     DC01<20>             Flags: <unique><active>
|_    HACKSTORE<1b>        Flags: <unique><active>

Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds