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

SMBExec

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


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4624Successful logonHighNetwork logon using admin credentials to remote host.
Security4672Special privileges assignedHighAdministrative privileges used for remote execution.
Security7045Service installedCriticalTemporary service created by SMBExec for command execution.
Security5140Network share accessedMediumAccess to ADMIN$ share during execution.
Sysmon1Process creationHighcmd.exe spawned via temporary service.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Temporary service creationShort‑lived service executing cmd.exeCriticalTypical SMBExec behavior.
ADMIN$ share accessRemote admin share usageHighUsed for payload delivery.
Service install followed by deletionService created then removed quicklyHighCommon lateral movement pattern.

Common Tools

ToolUsage
Impacket smbexec.pyRemote command execution via SMB service creation.
CrackMapExecAutomates SMB lateral movement.
Metasploit psexec modulesVariants using SMB service execution.

Relevant Artifacts

  • Security logs (4624, 4672, 7045)
  • SMB share access logs
  • Sysmon process events
  • Service creation artifacts
  • EDR telemetry

MITRE ATT&CK References

  • T1021.002 SMB/Windows Admin Shares
  • T1569.002 Service Execution

Decision Tree

  1. Detect service installation event.
  2. Identify originating host.
  3. Check administrative authentication.
  4. Pivot to created service binary or command.
  5. Determine lateral movement scope.

Example Detection Templates

KQL

SecurityEvent
| where EventID == 7045

EQL

process where event.code == "7045"

Sigma

title: SMBExec Service Execution
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 7045
  condition: selection
level: high

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
SMB restrictionsRestrict admin share accessHighLimits remote service creation.
MonitoringAlert on service installationsHighDetects lateral movement.
Least privilegeLimit admin credentialsCriticalReduces attack capability.