Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / ACTIVE DIRECTORY / ENUMERATION

SMB

This note documents detection patterns related to SMB Enumeration within Active Directory environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4624Successful logonMediumSMB authentication events preceding enumeration. Typically LogonType 3 (network).
Security5140A network share object was accessedHighIndicates access to shared resources such as ADMIN$, C$, IPC$, SYSVOL.
Security5145A network share object was checked to see whether client can access itCriticalFrequent checks against many shares often indicate enumeration activity.
Security4776NTLM authenticationMediumNTLM authentication used during SMB enumeration.
Sysmon3Network connectionHighConnections to TCP ports 445 or 139.
Sysmon1Process creationMediumExecution of enumeration tools such as CrackMapExec or smbclient.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Multiple share access checksRepeated 5145 events across many sharesCriticalClassic SMB enumeration pattern.
Enumeration of administrative sharesAccess attempts to ADMIN$, C$, IPC$HighOften indicates reconnaissance or lateral movement preparation.
SMB connections across many hostsSequential connections to multiple machinesHighAutomated scanning behavior.
Enumeration from user workstationSMB scanning originating from non-admin hostHighPossible attacker reconnaissance.
Execution of SMB enumeration toolsProcesses such as CrackMapExec or smbmapCriticalDirect evidence of enumeration activity.

Common Tools

ToolUsage
CrackMapExecEnumerates SMB shares, users, and permissions across hosts.
smbclientLists and accesses SMB shares.
smbmapEnumerates SMB share permissions.
Impacket smbclient.pyEnumerates SMB shares and credentials.
Nmap smb scriptsPerforms automated SMB discovery.

Relevant Artifacts

  • Domain controller Security logs (4624, 5140, 5145)
  • SMB access logs on target hosts
  • Network traffic logs for SMB connections
  • Sysmon logs (1, 3)
  • EDR telemetry identifying enumeration tools
  • Prefetch artifacts for CrackMapExec or smbclient
  • Authentication logs preceding enumeration
  • Network scanning telemetry

MITRE ATT&CK References

  • T1135 Network Share Discovery
  • T1018 Remote System Discovery
  • T1087 Account Discovery

Decision Tree

  1. Is the suspicious event present?
    • Identify SMB share enumeration events (5145).
  2. What host generated the event?
    • Determine workstation performing SMB connections.
  3. Is the account expected to perform this action?
    • Investigate whether account normally accesses many network shares.
  4. Pivot:
    • Source host → inspect execution of CrackMapExec or smbclient.
    • Network → analyze connections to multiple hosts.
    • Authentication → review credential usage during enumeration.
  5. Confirm exploitation
    • Determine whether attacker enumerated SMB shares to prepare for lateral movement.

Example Detection Templates

KQL

SecurityEvent
| where EventID == 5145
| summarize count() by IpAddress, ShareName, bin(TimeGenerated, 5m)
DeviceNetworkEvents
| where RemotePort in (445,139)
| summarize count() by InitiatingProcessAccountName, RemoteIP, bin(TimeGenerated,5m)

EQL

any where event.code == "5145"

Sigma

title: Suspicious SMB Share Enumeration
id: smb-enumeration-detection
status: experimental
description: Detects repeated SMB share access checks indicating possible enumeration
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5145
  condition: selection
fields:
  - SubjectUserName
  - ShareName
falsepositives:
  - Legitimate administrative scripts
level: medium
tags:
  - attack.discovery
  - attack.t1135

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
MonitoringAlert on repeated SMB share access attemptsHighDetects enumeration activity.
Network segmentationRestrict SMB access between workstationsHighReduces attack surface.
Least privilegeLimit access to administrative sharesHighPrevents unauthorized enumeration.
EDR monitoringDetect CrackMapExec or smbmap executionCriticalDirect detection of attacker tooling.
Threat huntingReview SMB traffic patterns regularlyMediumIdentifies reconnaissance behavior.