GO KALI FREE
AdvancedGuides

SMB Enumeration Complete Guide: Beginner to Advanced Windows Reconnaissance

A complete beginner-to-advanced SMB enumeration guide covering discovery, NetBIOS, share access, user enumeration, automation, troubleshooting, workflow design, and SMB tool selection.

#smb#enumeration#windows#samba#netbios#active directory#smbclient#enum4linux#netexec#crackmapexec#nbtscan
An authorized SMB session branches into share/file listing and supported RPC user/policy queries, then verifies effective read access before recording an inventory.
SMB enumeration and effective accessConceptual read-only inventory. Share visibility does not prove file access. smbclient handles shares/files; user and policy queries require appropriate RPC-capable tools.Original conceptual diagram. On narrow screens, scroll the figure to read the labels.

The Gateway to Windows Network Intelligence

SMB enumeration is the structured process of collecting information from systems that expose Server Message Block services. SMB powers Windows file sharing, printer sharing, named pipes, remote administration, and many Active Directory workflows. On modern networks it typically listens on TCP port 445, while older or Samba-based systems may use NetBIOS-based SMB on port 139.

For defenders, SMB enumeration reveals where file shares are exposed, which systems allow anonymous access, whether legacy protocols are still enabled, and how authentication behaves. For penetration testers, it is one of the most important reconnaissance phases because it can expose hostnames, workgroups, domains, share names, local users, password policies, and accessible files. For administrators, it is a practical way to audit file sharing hygiene before attackers do.

SMB Enumeration Cheat Sheet (Quick Reference)

These examples introduce scoped SMB enumeration. Replace each placeholder with a host you own or are explicitly authorized to assess. Anonymous access depends on server policy; when authentication is required, use the tool's documented credential mechanism for approved accounts. Share visibility does not prove read access, and user/policy queries require supported RPC operations.

Authorized SMB enumeration quick reference
TaskCommandDeep-dive guide
Probe SMB OS details when permittednmap -p 445 --script smb-os-discovery <lab-host>Nmap
List shares if guest access is permittedsmbclient -L <lab-host> -NSMBClient
Run all-simple enumerationenum4linux-ng -A <lab-host>Enum4linux-NG
Report shares visible to the sessionsmbmap -H <lab-host>SMBMap
Enumerate shares with permitted session contextnetexec smb <lab-host> --sharesNetExec
Open a policy-permitted anonymous RPC consolerpcclient -U "" -N <lab-host>
Query NetBIOS namesnbtscan <lab-host>NBTscan

Beginner Foundations

SMB is easy to misunderstand because several components overlap. SMB itself handles file and printer sharing. CIFS is an older SMB dialect name often used casually to describe Windows shares. Samba is the open-source implementation that allows Linux and Unix systems to serve or access SMB shares. NetBIOS is the older naming and session layer that Windows networks used heavily before direct-host SMB on port 445 became standard.

When you enumerate SMB, you are usually trying to answer practical questions. Is the host running SMB? What is the hostname? Is it a workstation, server, NAS, or domain controller? Which shares exist? Can anonymous users list shares? Can authenticated users read or write files? Are there local users that can be used for password auditing? Does the password policy permit brute-force attempts, or would that lock out accounts? Is SMB signing required? Is SMBv1 still enabled?

The beginner workflow is intentionally simple: find hosts, confirm SMB ports, resolve NetBIOS names, enumerate shares and users, test share access, then document findings. NBTScan is useful early because it quickly identifies Windows-style names and workgroups across a local subnet. Enum4Linux and Enum4Linux-NG collect deeper host data. SMBClient verifies whether the discovered shares are actually accessible. Automation tools such as CrackMapExec and NetExec become more valuable as the target count grows.

SMB Ports and What They Mean

Authorized SMB enumeration quick reference
PortProtocolPurposeEnumeration Value
137/UDPNetBIOS Name ServiceHostname and workgroup resolutionUseful for quick Windows host identification
138/UDPNetBIOS DatagramLegacy browse announcementsSometimes reveals legacy Windows networking behavior
139/TCPNetBIOS SessionSMB over NetBIOSCommon on legacy Windows and Samba systems
445/TCPDirect-host SMBModern SMB file sharing and named pipesPrimary SMB enumeration target
389/TCPLDAPActive Directory directory queriesUseful when SMB host is also a domain controller
88/TCP/UDPKerberosAD authenticationHelps identify domain controller role

Port 445 is the first port to check. If port 445 is open, modern SMB enumeration can proceed. If only port 139 is open, the target may depend on NetBIOS. If both are filtered, SMB tools will usually fail regardless of credentials. If LDAP and Kerberos are open alongside SMB, the system may be a domain controller and should be handled with extra care.

Tool Comparison Table

Authorized SMB enumeration quick reference
ToolBest UseStrengthsLimitationsSkill Level
NBTScanFast NetBIOS discoveryLightweight, quick subnet visibility, useful hostnamesLimited to NetBIOS data, no share or user enumerationBeginner
Enum4LinuxClassic SMB enumerationUsers, groups, shares, policies, NetBIOS detailsText-heavy output, weaker modern automationBeginner
Enum4Linux-NGModern structured SMB enumerationJSON/CSV output, cleaner errors, improved parsingSyntax differs slightly from originalBeginner to Intermediate
SMBClientInteractive share accessLists shares, browses files, uploads/downloads, verifies accessManual per share, not ideal for large networksBeginner
CrackMapExecLarge-scale SMB automationParallel credential checks, users, shares, policies, hash workflowsHigh noise, dangerous outside authorized assessmentsIntermediate to Advanced
NetExecModern CME-style operationsActively maintained, SMB/LDAP/WinRM workflows, AD focusRequires careful scope and credential handlingIntermediate to Advanced
HydraSMB password auditingProtocol brute-force support and wordlist testingLockout risk, less context than AD-aware toolsIntermediate

No single tool replaces the others. NBTScan helps you discover names quickly. Enum4Linux gives broad enumeration. SMBClient proves access. CrackMapExec and NetExec scale the same concepts across many hosts. Hydra is useful only when password testing is in scope and lockout risk has been understood.

Complete Workflow

Step 1: Define Scope and Safety Rules

Before running tools, define the authorized IP ranges, testing window, credential rules, and account lockout thresholds. SMB enumeration can generate authentication logs and, if mishandled, lock accounts or alert defenders. In professional work, scope is not a formality. It decides which subnets can be scanned, which credentials may be used, whether brute-force testing is allowed, and how sensitive files should be handled if discovered.

Step 2: Discover Live Hosts

Start by identifying reachable hosts. On a local lab or internal network, ARP discovery is reliable. On routed networks, use ping sweeps or TCP probes. The goal is to reduce noise by avoiding deep SMB enumeration against addresses that are offline.

nmap -sn 192.168.1.0/24

Keep the live host list. It becomes the input for the SMB port scan.

Step 3: Confirm SMB Services

Scan only the SMB-relevant ports first. This tells you which hosts deserve deeper enumeration.

nmap -p 139,445 --open 192.168.1.0/24

When port 445 is open, continue with SMB enumeration. If port 139 is open, add NetBIOS checks. If LDAP, Kerberos, or DNS are open on the same host, note that it may be a domain controller.

Step 4: Resolve NetBIOS Names with NBTScan

NBTScan quickly converts IP addresses into useful Windows context. Hostnames, workgroups, and domain hints help you prioritize servers over workstations and identify naming patterns.

nbtscan 192.168.1.0/24

Look for names that suggest file servers, domain controllers, backups, accounting, engineering, or NAS devices. These names are not proof of sensitivity, but they help direct later testing.

Step 5: Run Baseline SMB Enumeration

Use Enum4Linux for a broad first pass on individual targets. The all-in-one scan checks users, groups, shares, policies, and NetBIOS details.

enum4linux -a 192.168.1.10

For cleaner output and automation, use Enum4Linux-NG:

enum4linux-ng -A 192.168.1.10 -oJ enum_192.168.1.10.json

Focus on shares, account names, password policy, domain/workgroup names, and whether null sessions were allowed. Do not assume every discovered share is accessible. Enumeration and access are separate steps.

Step 6: Verify Shares with SMBClient

SMBClient is where enumeration becomes proof. First list shares anonymously, then test specific shares.

smbclient -L //192.168.1.10 -N
smbclient //192.168.1.10/public -N

With authorized credentials:

smbclient -L //192.168.1.10 -U 'CORP\analyst'
smbclient //192.168.1.10/projects -U 'CORP\analyst'

Inside the SMBClient shell, use ls, cd, get, put, recurse, and mget carefully. For audits, avoid bulk downloads unless the rules of engagement permit it. Often a directory listing and a small approved sample are enough to prove exposure.

Step 7: Scale with CrackMapExec or NetExec

When there are many SMB hosts, manual enumeration becomes inefficient. CrackMapExec and NetExec automate share enumeration, credential validation, user listing, and password policy checks across ranges.

crackmapexec smb 192.168.1.0/24 --shares
netexec smb 192.168.1.0/24 -u analyst -p 'Password123' --shares

Use these tools carefully. They are powerful, noisy, and often associated with adversary tradecraft. In production assessments, coordinate timing with defenders and avoid options that dump secrets unless explicitly authorized.

Step 8: Test Credentials Only When Authorized

SMB password testing can be useful for validating password hygiene, but it carries lockout and operational risk. Review the password policy first. If lockout is enabled after five failures, a brute-force run with Hydra is inappropriate unless a safe test account and approved wordlist are used.

hydra -l audituser -P approved-small-list.txt smb://192.168.1.10

For domain environments, password spraying with strict rate limits is safer than brute forcing a single account repeatedly, but it must still be authorized and controlled.

Intermediate Analysis: What to Look For

The most important SMB findings are not always the most dramatic. Anonymous share listing is useful, but anonymous read or write access is much more serious. Writable shares may allow data staging or malicious file placement. Shares containing backups, scripts, configuration files, SSH keys, database exports, password spreadsheets, or deployment artifacts deserve immediate attention.

User enumeration matters because valid usernames improve password auditing and phishing risk analysis. Password policy data matters because it tells you whether the organization has basic controls such as minimum length, lockout, and history. SMB signing matters because disabled signing can support relay attacks in certain environments. SMBv1 matters because it is obsolete and historically associated with severe vulnerabilities.

When comparing tool output, verify important findings with at least two methods. For example, if Enum4Linux reports a share, confirm with SMBClient. If Nmap reports SMB signing disabled, confirm with a dedicated SMB security mode check. If CrackMapExec says credentials are valid, verify the scope of access rather than assuming administrative control.

Advanced SMB Enumeration

Advanced enumeration is less about running more flags and more about correlation. In enterprise networks, SMB hosts often represent different roles: workstations, file servers, domain controllers, print servers, backup appliances, and NAS devices. Each role changes the risk model.

For domain controllers, SMB enumeration should be combined with LDAP and Kerberos context. A domain controller exposing SMB is normal, but the value of information gathered from it is high. User lists, group membership, password policies, SYSVOL contents, and legacy scripts can reveal privilege paths. For file servers, the priority is share access, permission boundaries, and sensitive data exposure. For workstations, SMB may reveal local admin reuse, open administrative shares, or lateral movement paths.

Advanced operators build target lists in phases. First, identify all SMB hosts. Second, classify host roles using names, ports, banners, and domain data. Third, run light enumeration broadly. Fourth, run deeper checks only against prioritized hosts. This approach reduces noise and produces cleaner reporting.

Automation should produce structured output. Enum4Linux-NG JSON, Nmap XML, and NetExec output can be normalized into a spreadsheet or graph. Track host, role, SMB ports, signing status, SMB dialect, shares, access level, credentials used, and evidence path. The result is not just a pile of terminal output but a defensible assessment record.

Troubleshooting

Authorized SMB enumeration quick reference
SymptomLikely CauseFix
Connection refusedSMB service is not listening or firewall blocks accessVerify with nmap -p 139,445 <target> and confirm scope routing
TimeoutFiltered ports, host firewall, slow network, or wrong IPIncrease timeout, validate host is live, test from same network segment
NT_STATUS_ACCESS_DENIEDShare exists but current identity lacks permissionTry authorized credentials or test a different share
NT_STATUS_LOGON_FAILUREBad username, password, domain, or account stateCheck domain format, account lockout, and credential validity
NT_STATUS_BAD_NETWORK_NAMEShare name is wrong or unavailableList shares with smbclient -L before connecting
Empty Enum4Linux outputNull sessions blocked or SMB hardening enabledUse valid credentials or switch to authenticated NetExec/CME checks
NetBIOS names missingNetBIOS disabled or UDP 137 blockedRely on DNS, SMB OS discovery, or AD data instead
Account lockoutsToo many failed authentication attemptsStop testing, notify stakeholders, reduce rate, use safe test accounts

Troubleshooting should be methodical. First prove network reachability. Then prove the port is open. Then prove the authentication format is correct. Then test authorization to specific shares. Avoid changing many variables at once because SMB errors can look similar even when the causes differ.

Reporting Workflow

Good SMB reporting translates technical output into risk. Document the target host, share name, access level, authentication context, evidence, business impact, and remediation. For example, "anonymous read access to \FILE01\Backups exposed database exports" is stronger than "SMB share open." Include exact commands only when they help reproduce the finding safely.

Prioritize findings by impact. Anonymous write access is usually critical or high. Anonymous read access to sensitive data is high. SMBv1 enabled is high in most environments. SMB signing disabled may be medium or high depending on relay exposure. Excessive permissions for authenticated users may vary based on data sensitivity.

Recommendations should be specific: remove anonymous access, disable SMBv1, require SMB signing where appropriate, enforce least-privilege share and NTFS permissions, monitor share access, rotate exposed credentials, and review file servers periodically.

FAQ

What is the best SMB enumeration tool for beginners?

Start with Enum4Linux for broad enumeration and SMBClient for share access verification. Add NBTScan when you need quick NetBIOS names across a subnet.

Is SMB enumeration legal?

SMB enumeration is legal only on systems you own or have explicit written permission to test. Unauthorized enumeration can violate computer misuse laws and trigger security monitoring.

What is the difference between Enum4Linux and SMBClient?

Enum4Linux discovers information such as users, groups, shares, and password policies. SMBClient connects to shares and performs file operations. Use Enum4Linux to find targets and SMBClient to verify access.

Should I use CrackMapExec or NetExec?

Use NetExec for modern maintained workflows where possible. CrackMapExec is still widely documented and useful in labs, but NetExec is the forward-looking option for many operators.

Why does anonymous SMB enumeration fail on modern Windows?

Modern Windows configurations often restrict null sessions, require authentication, or enforce SMB signing. This is expected hardening. Use authorized credentials when the assessment scope permits it.

How do I avoid locking accounts during SMB testing?

Retrieve the password policy first, use approved test accounts, avoid repeated failures, and rate-limit any password testing. Do not run Hydra or spraying tools against production accounts without explicit approval.

What SMB findings matter most?

Anonymous write access, sensitive data exposure, SMBv1, disabled signing in relay-prone environments, weak password policies, and excessive access for broad groups such as Everyone or Domain Users are high-priority findings.

Related SMB Tool Recommendations

  • SMBClient - Verify share access, browse files, and test anonymous or authenticated SMB sessions.
  • Enum4Linux - Enumerate SMB users, groups, shares, policies, and NetBIOS details.
  • Enum4Linux-NG - Use modern structured output for repeatable SMB enumeration.
  • NBTScan - Quickly resolve NetBIOS names and workgroups across local networks.
  • CrackMapExec - Scale SMB enumeration and credential validation across many hosts.
  • NetExec - Use the modern CME-style toolkit for SMB, LDAP, WinRM, and AD workflows.
  • Hydra - Perform tightly scoped SMB password auditing only when lockout-safe and authorized.
  • Summary

    SMB enumeration is a complete ecosystem, not a single command. Beginners should learn the sequence of discovery, port validation, NetBIOS lookup, SMB enumeration, and SMBClient verification. Intermediate users should correlate users, shares, policies, and permissions into findings. Advanced practitioners should scale carefully with NetExec or CrackMapExec, structure output, and map SMB exposure into Active Directory risk. The best results come from disciplined workflow, explicit authorization, careful troubleshooting, and clear reporting.

    Frequently Asked Questions

    What is SMB enumeration and why is it important?

    SMB enumeration is the structured process of collecting information from systems exposing Server Message Block services. It reveals hostnames, share names, user accounts, password policies, and accessible files, making it essential for both penetration testing and security auditing of Windows environments.

    What are the key SMB ports to scan during enumeration?

    Port 445/TCP is the primary modern SMB port, port 139/TCP is legacy NetBIOS-based SMB, UDP 137 handles NetBIOS name resolution, and UDP 138 carries NetBIOS datagrams. If LDAP (389) and Kerberos (88) are also open, the host may be a domain controller.

    What is the difference between Enum4Linux and SMBClient?

    Enum4Linux discovers information like users, groups, shares, and password policies through enumeration. SMBClient connects to shares and performs file operations like listing, downloading, and uploading. Use Enum4Linux to find targets and SMBClient to verify actual access.

    Should I use CrackMapExec or NetExec for SMB enumeration?

    Use NetExec for modern maintained workflows as it is the actively developed successor. CrackMapExec is still widely documented and useful in labs, but NetExec is the forward-looking option with improved SMB, LDAP, and WinRM workflows.

    How do I avoid locking accounts during SMB testing?

    Retrieve the password policy first to understand lockout thresholds, use approved test accounts, avoid repeated failures, and rate-limit any password testing. Never run brute-force tools against production accounts without explicit authorization and a safe test account.

    What SMB findings matter most in a security assessment?

    Anonymous write access is usually critical, anonymous read access to sensitive data is high, SMBv1 enabled is high, disabled signing in relay-prone environments is medium-high, weak password policies are medium, and excessive permissions for broad groups like Everyone are high-priority findings.

    Why does anonymous SMB enumeration fail on modern Windows?

    Modern Windows configurations restrict null sessions, require authentication, or enforce SMB signing by default. This is expected hardening. Use authorized credentials when the assessment scope permits authenticated enumeration.

    How do you verify SMB signing status on a target?

    Run nmap -p 445 --script smb-security-mode target to check whether signing is enabled or required. You can also use CrackMapExec's relay list generation to identify hosts with signing disabled that are vulnerable to NTLM relay attacks.

    What is the recommended SMB enumeration workflow?

    Follow this sequence: define scope and safety rules, discover live hosts, confirm SMB ports, resolve NetBIOS names with NBTScan, run baseline enumeration with Enum4Linux, verify shares with SMBClient, scale with CrackMapExec or NetExec, and test credentials only when authorized.

    How do you handle SMB errors like NT_STATUS_ACCESS_DENIED?

    This error means the share exists but your current identity lacks permission. Try authorized credentials, test a different share, or verify the domain format. Connection refused usually means SMB is not running or a firewall blocks access.

    Continue Learning

    Guides · Beginner

    Windows Reconnaissance Basics: Network Discovery and Enumeration

    Learn the fundamentals of Windows network reconnaissance including host discovery, port scanning, NetBIOS enumeration, and Active Directory mapping using Kali Linux tools.

    Guides · Advanced

    Enterprise Network Reconnaissance: Large-Scale Windows Environment Mapping

    Guide to performing reconnaissance across large enterprise Windows networks including domain enumeration, Active Directory mapping, and automated tool integration.

    Guides · Intermediate

    SMB Security Assessment: Testing Share Permissions and Access Controls

    Guide to assessing SMB security including anonymous access testing, share permission analysis, credential attacks, and hardening recommendations for Windows file shares.

    Tools · Beginner

    SMB Enumeration Guide: Discovering Windows Shares and Users

    Complete guide to SMB enumeration for discovering Windows shares, users, groups, and network resources using Enum4Linux, SMBClient, NBTScan, and Nmap.

    Related Security Tools

    Information Gathering

    Enum4linux

    Learn how to use Enum4linux to enumerate Windows and Samba systems over SMB: install it on Kali Linux, run your first scan, read the users, shares, groups and password policy it returns, and switch to enum4linux-ng for modern hosts that block null sessions.

    Written by GO KALI FREE Team