Detecting Malicious Windows Share Manipulation via net.exe
Attackers utilize the net.exe utility to create or delete Windows shares as a mechanism for lateral movement, data exfiltration, and establishing persistence.
Attackers frequently leverage the native Windows utility net.exe to manipulate network shares as part of post-exploitation activities. This technique allows adversaries to create shares for staging sensitive data prior to exfiltration, or to delete existing shares to hinder forensic analysis or disrupt system operations. This activity has been observed in association with various malware families and campaigns, including Hidden Cobra, Prestige Ransomware, and DarkGate. Defenders must distinguish this malicious use of net.exe from legitimate administrative actions performed by system administrators or automated scripts. Effective detection requires visibility into granular process telemetry, specifically capturing the full command-line arguments and parent process context associated with net.exe.
Attack Chain
- Initial access is established through phishing or exploitation of a network-facing service.
- The attacker executes a discovery command to identify existing network resources and file shares.
- The adversary identifies a target directory or system for staging data or malware.
- The attacker executes
net.exe share <name>=<path>to create a new, potentially hidden or unauthorized network share. - Sensitive files are moved or copied into the newly created share for centralized access or exfiltration.
- The attacker uses
net.exe share <name> /deleteto remove the share after the data has been exfiltrated to minimize the forensic footprint. - Final objectives, such as data exfiltration or the propagation of ransomware, are completed.
Impact
Unauthorized modification of network shares can facilitate large-scale data exfiltration, enable the rapid spread of malware across an enterprise network, or result in significant service disruption. Persistent shares created by attackers can also serve as long-term backdoors for re-entry into the environment.
Recommendation
- Deploy the provided Sigma rule to monitor
net.execommand-line arguments indicative of share manipulation. - Baseline administrative activity in your environment to distinguish legitimate share management from potential adversary behavior.
- Enable Sysmon or equivalent EDR process-creation logging to ensure the full
CommandLinefield is captured for analysis. - Integrate the identified
net.exepatterns with risk-based alerting in your SIEM to correlate this activity with other suspicious behaviors like credential dumping or lateral movement.
Immediate actions
Deploy Sigma rule to SIEM
Threat Hunt
Search for net.exe execution with share parameters over the last 30 days.
Data: Process creation logs
Mitigations
Restrict command-line access for non-privileged accounts
T1070.005
Detection coverage 1
Detect Windows Share Creation or Deletion via net.exe
mediumDetects the use of net.exe to create, delete, or modify Windows network shares, a common technique for post-exploitation staging.
Detection queries are available on the platform. Get full rules →