DailyGlimpse

Mastering Service Enumeration: A Deep Dive into SMB, SNMP, SMTP, and LDAP for PenTest+

AI
April 27, 2026 · 3:29 PM

In the world of penetration testing, knowing which services are running on a target is only half the battle. True reconnaissance requires moving beyond simple port lists to understand the protocols behind them. This comprehensive guide explores four critical services—SMB, SNMP, SMTP, and LDAP—and the enumeration techniques that turn raw ports into actionable intelligence.

Why Protocol Enumeration Matters More Than Port Lists

A port scan tells you that TCP/445 is open, but it doesn't reveal whether the server allows null sessions or what shares are accessible. Protocol enumeration bridges this gap, allowing testers to map out user accounts, system configurations, and potential attack vectors.

SMB Enumeration: Shares, Users, and Version Detection

Server Message Block (SMB) is a staple in Windows environments. Common enumeration techniques include:

  • Null sessions: Anonymous connections that may expose user lists, share names, and even full domain information.
  • Tools like enum4linux: A script that automates the extraction of user lists, share listings, and OS details from SMB.
  • Share enumeration: Identifying accessible shares and their permissions.

Version detection is critical because older SMB versions (e.g., SMBv1) are vulnerable to attacks like EternalBlue, while newer versions offer better security.

SNMP Enumeration: Community Strings and MIB Walking

Simple Network Management Protocol (SNMP) is often misconfigured with default community strings ("public", "private"). Key enumeration steps:

  • Community string guessing: Try common strings to gain read or read-write access.
  • MIB walking with snmpwalk or snmp-check: Retrieve the entire Management Information Base (MIB) tree, revealing device details, running processes, and network interfaces.
  • Read-write risks: With write access, an attacker can alter device configurations.

SMTP Enumeration: VRFY, EXPN, and User Harvesting

Simple Mail Transfer Protocol (SMTP) can leak user information if not properly configured. Techniques include:

  • VRFY command: Verifies if a user exists on the server.
  • EXPN command: Expands mailing lists or aliases.
  • Tools like smtp-user-enum: Automates user enumeration by issuing VRFY or EXPN to a mail server.

This information can feed into further attacks like password spraying or phishing.

LDAP Enumeration: Active Directory from the Outside

Lightweight Directory Access Protocol (LDAP) is the backbone of Active Directory. Without proper access controls, attackers can:

  • Perform null binds: Attempt anonymous queries to retrieve directory information.
  • Enumerate users, groups, and computers: Extract large portions of the AD structure.

Even without valid credentials, misconfigured LDAP can reveal domain admin usernames, group memberships, and service accounts.

Putting It Together: Cross-Protocol Target Profiling

Combining information from multiple protocols creates a comprehensive profile. For example, SMB user lists paired with SMTP verified addresses can identify potential targets for credential attacks. SNMP device details can reveal patch levels, while LDAP enumeration provides the organizational hierarchy.

Quiz Time

Test your knowledge:

  1. What tool can automatically enumerate SMB shares and users via null sessions?
  2. Which SNMP community string often provides read-only access by default?
  3. What SMTP command expands a mailing list to reveal member addresses?
  4. How does a null bind work in LDAP enumeration?

By mastering these techniques, penetration testers can transform a simple port list into a detailed map of the target's digital infrastructure.