T1070.005 Network Share Connection Removal
Sub-technique of: T1070
High-Level Description
Adversaries may remove share connections that are no longer useful in order to clean up traces of their operation. Windows shared drive and SMB/Windows Admin Shares connections can be removed when no longer needed. Net is an example utility that can be used to remove network share connections with the net use \system\share /delete command.
Kill Chain Phase
- Defense Evasion (TA0005)
Platforms: Windows
What to Check
- Identify if Network Share Connection Removal technique is applicable to target environment
- Check Windows systems for indicators of Network Share Connection Removal
- Assess detection coverage (1 detection strategies)
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: Add Network Share
Add a Network Share utilizing the command_prompt
Supported Platforms: windows
net use c: #{share_name}
net share test=#{share_name} /REMARK:"test share" /CACHE:No
Atomic Test 2: Remove Network Share
Removes a Network Share utilizing the command_prompt
Supported Platforms: windows
net share #{share_name} /delete
Atomic Test 3: Remove Network Share PowerShell
Removes a Network Share utilizing PowerShell
Supported Platforms: windows
Remove-SmbShare -Name #{share_name}
Remove-FileShare -Name #{share_name}
Atomic Test 4: Disable Administrative Share Creation at Startup
Administrative shares are hidden network shares created by Microsoft’s Windows NT operating systems that grant system administrators remote access to every disk volume on a network-connected system. These shares are automatically created at started unless they have been purposefully disabled as is done in this Atomic test. As Microsoft puts it, "Missing administrative shares typically indicate that the computer in question has been compromised by malicious software." https://threatpost.com/conti-ransomware-gang-has-full-log4shell-attack-chain/177173/
Supported Platforms: windows Elevation Required: Yes
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v AutoShareServer /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v AutoShareWks /t REG_DWORD /d 0 /f
Atomic Test 5: Remove Administrative Shares
Administrative shares are hidden network shares created by Microsoft’s Windows NT operating systems that grant system administrators remote access to every disk volume on a network-connected system. As Microsoft puts it, “Missing administrative shares typically indicate that the computer in question has been compromised by malicious software. https://threatpost.com/conti-ransomware-gang-has-full-log4shell-attack-chain/177173/
Supported Platforms: windows Elevation Required: Yes
for %i in (C$ IPC$ ADMIN$) do net share %i /delete
Manual Testing
If Atomic Red Team tests are not applicable, manually verify the technique by:
Identify Attack Surface: Determine if the target environment is susceptible to Network Share Connection Removal by examining the target platforms (Windows).
Assess Existing Defenses: Review whether mitigations for T1070.005 are in place. If defenses are absent or misconfigured, this technique may be exploitable.
Execute Test: Use tools and methods described in the MITRE ATT&CK page and external references below.
Remediation Guide
No specific mitigations documented for this technique.
Detection
Behavioral Detection of Network Share Connection Removal via CLI and SMB Disconnects
Risk Assessment
| Finding | Severity | Impact |
|---|---|---|
| Network Share Connection Removal technique applicable | Low | Defense Evasion |
CWE Categories
| CWE ID | Title |
|---|---|
| CWE-693 | Protection Mechanism Failure |