Detection of Administrative SMB Share Access via Dir Command
This detection targets the use of the 'dir' command to access sensitive Windows administrative SMB shares (Admin$, IPC$, C$), a behavior often utilized by attackers for lateral movement and staging of malicious tools.
Adversaries frequently target Windows administrative SMB shares, specifically Admin$, IPC$, and C$, to facilitate lateral movement and remote code execution within an enterprise environment. Tools like PsExec and PaExec leverage these shares to stage malicious binaries and create remote services. Attackers often use the simple 'dir' command to enumerate or confirm connectivity to these shares prior to deploying secondary payloads. This technique has been observed in campaigns such as the IcedID malware propagation, where attackers move laterally to infect multiple hosts. Defenders should monitor for unexpected access to these administrative shares, especially when originating from non-administrative sources or unexpected workstations, as this activity is a critical indicator of pre-exploitation reconnaissance and staging.
Attack Chain
- Attacker gains initial access to a compromised endpoint within the environment.
- Attacker performs internal reconnaissance to identify reachable network assets.
- Attacker uses the 'dir' command or similar utilities to verify connectivity to administrative shares (\Admin$, \C$, \IPC$) on target hosts.
- Attacker copies malicious binaries or lateral movement tools to the identified administrative shares.
- Attacker creates a new service or modifies an existing service on the remote target to execute the staged binary.
- Attacker establishes persistent or remote execution access on the target system.
- Attacker proceeds with further malicious objectives, such as credential theft or ransomware deployment.
Impact
Successful exploitation of this technique enables attackers to move laterally through the network, escalate privileges, and deploy malware such as IcedID or ransomware. This can lead to significant operational disruption, widespread lateral infection, and potential data exfiltration across the organization.
Recommendation
Prioritize the identification of abnormal SMB share access patterns in the environment by ingesting Windows Security Event ID 5140 logs. Enable Object Access Auditing in Group Policy to ensure these events are generated. Deploy the following Sigma rule and filter out known legitimate administrative service accounts or automated system management tools to reduce false positives.
Immediate actions
Enable Windows Security Event ID 5140 collection
Threat Hunt
Analyze Event ID 5140 for connections to sensitive shares from non-IT subnets
Data: EventID 5140 logs
Mitigations
Restrict administrative share access via host-based firewalls
T1135
Detection coverage 1
Detect Administrative SMB Share Access via Dir Command
mediumDetects read access to administrative SMB shares (Admin$, IPC$, C$) which is often a precursor to lateral movement using tools like PsExec.
Detection queries are available on the platform. Get full rules →