Reconnaissance Techniques · Topic 7 of 8

Enumeration Concepts, NetBIOS, SNMP and LDAP

Learn enumeration for CEH: what it collects, key ports, NetBIOS names and nbtstat, SNMP community strings and MIBs, and LDAP directory queries.

  • 5 min
In a nutshell
  • Enumeration is active and reveals users, shares, hosts and device data.
  • NetBIOS: UDP 137 and 138, TCP 139; SMB direct: TCP 445.
  • SNMP uses UDP 161, with defaults "public" (read) and "private" (read and write).

What it is

Enumeration extracts detailed information from a live system by making active connections to its services. Where scanning shows that a port is open, enumeration asks the service what it knows.

Typical results are user names, group names, host names, shares, network resources, running services and device configuration. These details feed password attacks and targeted exploits.

Scan resultopen serviceQuery the servicedirect connectionCollectusers, shares, hostsUsepassword attacks, exploit choice

How it works

Enumeration concepts

Enumeration is more intrusive than footprinting, because the attacker is logged in or connected to the service. Many techniques rely on default settings or anonymous access.

TechniqueIdea
Extracting user names from email IDsThe part before the @ is often a login name
Using default passwordsDevices that keep their factory credentials
Brute force against a directory serviceGuessing credentials against a service such as Active Directory
Using SNMPReading device data with weak community strings
Using DNS zone transferCopying all records of a zone
Extracting user names from user groupsReading group membership lists

Common ports to know:

PortService
TCP and UDP 53DNS
TCP 135Microsoft RPC endpoint mapper
UDP 137, UDP 138, TCP 139NetBIOS name, datagram and session services
TCP 445SMB over TCP
UDP 161 and 162SNMP and SNMP traps
TCP 389 and 636LDAP and LDAP over SSL (LDAPS)
TCP 25SMTP
UDP 123NTP
TCP and UDP 2049NFS

NetBIOS enumeration

NetBIOS gives Windows computers names on a local network, and lets them share files and printers. A NetBIOS name is up to 16 characters, where the last character is a suffix that shows the service type.

SuffixMeaning
<00>Workstation service or domain name
<03>Messenger service
<20>File server service
<1B>Domain master browser
<1C>Domain controllers
<1D>Master browser

The Windows command nbtstat shows NetBIOS statistics and name tables. Its -a option queries a remote computer by name, -A queries by IP address, -c shows the local name cache and -n shows the local name table. Scripts in Nmap and tools such as NetBIOS Enumerator show names, shares and logged-in users.

Null sessions, an anonymous connection to a Windows share, were once a common way to list users and shares. Modern Windows restricts them, but the exam still describes the concept.

SNMP enumeration

The Simple Network Management Protocol manages network devices such as routers, switches and printers. A manager asks an agent on the device for data, and the agent can also send unsolicited traps.

ItemMeaning
Community stringA shared password. Defaults are "public" for read and "private" for read and write in SNMP versions 1 and 2c
MIBManagement Information Base, a database of manageable objects
OIDObject identifier, the number that names one MIB object
Agent portUDP 161 (traps use UDP 162)

SNMP version 1 and 2c send community strings in clear text. Version 3 adds authentication and encryption, with the levels noAuthNoPriv, authNoPriv and authPriv.

An attacker who guesses the community string can walk the MIB and read interface lists, routing tables, running processes, installed software and user accounts. Tools for this include snmpwalk, SnmpCheck and OpUtils.

LDAP enumeration

The Lightweight Directory Access Protocol queries and edits directory services such as Active Directory. Entries have attributes such as names, email addresses, groups and computer accounts.

ItemDetail
PortsTCP 389 (LDAP) and TCP 636 (LDAPS), plus 3268 and 3269 for the Active Directory global catalog
Anonymous bindA connection with no credentials, which should be disabled
InformationUsers, groups, computers, organizational units and policies
Toolsldapsearch, JXplorer, Softerra LDAP Administrator, Nmap scripts

Countermeasures for these three

  • Disable NetBIOS over TCP/IP where it is not needed, and block ports 137 to 139 and 445 at the border.
  • Restrict anonymous access and null sessions in the operating system settings.
  • Use SNMP version 3, change default community strings, and block UDP 161 and 162 from outside.
  • Require authenticated and encrypted LDAP binds, and restrict who can read directory attributes.
  • Apply least privilege and monitor for large numbers of queries.

A worked example

A scan shows UDP 161 open on a switch. The tester tries the default community string "public", reads the interface table and the system description, and finds the device model and software version. The report recommends SNMP version 3, a custom string for any remaining version 2c use and an access list that allows only the management station.

How the exam asks about this

  • "Which Windows command lists NetBIOS names of a remote host?" -> nbtstat (with -a or -A).
  • "Which SNMP community string normally gives read-write access by default?" -> private.
  • "Which port does LDAP use by default?" -> TCP 389.

What to remember for the exam

  • Enumeration is active and reveals users, shares, hosts and device data.
  • NetBIOS: UDP 137 and 138, TCP 139; SMB direct: TCP 445.
  • SNMP uses UDP 161, with defaults "public" (read) and "private" (read and write).
  • SNMPv3 adds authentication and encryption.
  • LDAP is TCP 389, LDAPS is TCP 636.
Watch out

Do not mix SNMP port 161 (agent queries) with port 162 (traps sent to the manager).

Common mistakes

Confusing scanning with enumeration. Scanning finds open ports. Enumeration pulls account and resource details from them.

Assuming SNMP is safe because it is read only. Reading a full configuration is already a serious leak.

Forgetting that SMB uses TCP 445. Older NetBIOS used 139, but modern SMB can run directly over 445.

Check yourself

  • What does the nbtstat -A option do?

    It queries the NetBIOS name table of a remote computer by its IP address.

  • What are the default SNMP community strings?

    "public" for read access and "private" for read and write access.

  • Which LDAP port is encrypted by default?

    TCP 636, LDAPS.

Topic 7 of 8 in Reconnaissance Techniques

Test yourself on Reconnaissance Techniques

The full EC-Council 312-50 question bank has 1,000 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by EC-Council. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.