ADMIN$
EVENT 5140
EVENT 5145
SMB
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting ADMIN$, C$ and IPC$ Share Abuse

Nearly every Windows lateral movement tool touches an administrative share first. The question is who wrote what, from where.

Scroll

ADMIN$ maps to the Windows directory, C$ to the system drive and IPC$ carries named pipes. PsExec, smbexec, wmiexec, secretsdump and many ransomware deployers use them to stage binaries or read output. Because the shares exist on every host, the detection signal is the write and its origin, not the share name.

Signals at a Glance

SignalWhereATT&CK
Network share accessed with ADMIN$ or C$ (first connect)Security 5140T1021.002
Detailed file-share access with write access to an executable or scriptSecurity 5145T1570
Executable or DLL created in the Windows directory by the System processSysmon 11T1570
IPC$ access to named pipes such as svcctl, atsvc, winreg, lsarpcSecurity 5145, Zeek smbT1021.002
One source connecting to ADMIN$ on many hosts in minutesZeek smb_mapping, 5140T1021.002

Share Events and Write Detection

Event 5140 fires once per session when a share is accessed; Event 5145 logs each file-level request and is the one that shows what was written. 5145 is voluminous, so scope the audit policy to the administrative shares or collect it only on servers and sensitive hosts. A starting-point search for writes of executable content:

index=wineventlog EventCode=5145 (Share_Name="\\\\*\\ADMIN$" OR Share_Name="\\\\*\\C$")
  (Relative_Target_Name="*.exe" OR Relative_Target_Name="*.dll" OR Relative_Target_Name="*.bat"
   OR Relative_Target_Name="*.ps1" OR Relative_Target_Name="*.sys")
  Access_Mask IN ("0x2", "0x6", "0x12019f", "0x1f01ff")
| stats count values(Relative_Target_Name) as files dc(Relative_Target_Name) as n
        by Source_Address, Account_Name, ComputerName
| sort - n
# tune/validate: access-mask values differ by client; confirm with a PsExec test in a lab.

Pair it with the file-creation event on the endpoint, which names the file even if share auditing was not enabled. Writes arriving over SMB are attributed to the System process, so a PE file created by System in the Windows directory is a strong indicator:

// Microsoft Defender (KQL) - executable dropped into system paths by SMB service context
DeviceFileEvents
| where ActionType == "FileCreated"
| where InitiatingProcessFileName =~ "System" or InitiatingProcessId == 4
| where FolderPath startswith @"C:\Windows\" and FileName endswith_cs ".exe"
| where FolderPath !has @"\WinSxS\" and FolderPath !has @"\servicing\"
| project Timestamp, DeviceName, FolderPath, FileName, SHA256, InitiatingProcessAccountName
// tune/validate: initiating-process attribution for SMB writes varies by product.

Network Visibility

If host auditing is incomplete, SMB is visible on the wire. Zeek logs share mappings in smb_mapping.log and file operations in smb_files.log. Suricata 7 exposes SMB sticky buffers for share names and pipes:

# Suricata (validate syntax against your version and rule engine)
alert smb any any -> $HOME_NET 445 ( \
  msg:"HUNT SMB tree connect to ADMIN$ from non-admin source"; \
  flow:established,to_server; \
  smb.share; content:"ADMIN$"; nocase; \
  threshold:type both, track by_src, count 5, seconds 300; \
  classtype:policy-violation; sid:9100001; rev:1; )
# tune/validate: add a negation for approved admin subnets using a variable such as $ADMIN_NETS.
Vetted sources

Use the SigmaHQ admin-share and SMB rules, Elastic and Splunk ESCU SMB lateral movement content and MITRE CAR analytics for remote file copy. Zeek smb logs and Suricata give a host-independent view, and Atomic Red Team can replay share access. Baseline your own environment: backup, antivirus update and software distribution systems use these shares legitimately.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026