T1070.005

Network Share Connection Removal

Adversaries remove Windows network share connections after use to clean up traces of lateral movement and data access. Network shares mapped via net use or UNC paths leave artifacts in the Windows registry (HKCU\Network), Windows event logs (Event ID 5140 — network share object accessed, Event ID 5142 — network share created), and in the MRU list. The primary utility for removal is net use \\target\share /delete or net use * /DELETE /Y to remove all mapped drives simultaneously. RobbinHood ransomware used net use * /DELETE /Y to disconnect all network shares before encryption, likely to ensure local encryption of any mapped network paths. Threat Group-3390 detached network shares after exfiltrating files. InvisiMole, DUSTTRAP (APT41), and various ransomware families routinely perform share cleanup as a post-exploitation step.

Microsoft Sentinel / Defender
kusto
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "net.exe" or FileName =~ "net1.exe"
| where ProcessCommandLine has "use" and ProcessCommandLine has_any ("/delete", "/DELETE", "/d")
| project Timestamp, DeviceName, AccountName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
| union (
    DeviceProcessEvents
    | where Timestamp > ago(24h)
    | where FileName =~ "net.exe" or FileName =~ "net1.exe"
    | where ProcessCommandLine has "use" and ProcessCommandLine has "*"
    | project Timestamp, DeviceName, AccountName, ProcessCommandLine,
             InitiatingProcessFileName, InitiatingProcessCommandLine
)
| sort by Timestamp desc
high severity medium confidence

Data Sources

Process: Process Creation Network Share: Network Share Access Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • IT administrators running scripts that map and then unmap network shares as part of batch file operations
  • Logoff scripts configured in Group Policy that disconnect mapped drives when users log off
  • VPN clients that disconnect network shares when the VPN session ends and reconnect when it re-establishes
  • Backup agents that map network backup destinations, perform backup, then disconnect

Unlock Pro Content

Get the full detection package for T1070.005 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections