2018-07-06 19:56:24 +00:00
# T1126 - Network Share Connection Removal
## [Description from ATT&CK](https://attack.mitre.org/wiki/Technique/T1126)
2018-11-14 20:59:18 +00:00
<blockquote>Windows shared drive and [Windows Admin Shares ](https://attack.mitre.org/techniques/T1077 ) connections can be removed when no longer needed. [Net ](https://attack.mitre.org/software/S0039 ) is an example utility that can be used to remove network share connections with the <code>net use \\system\share /delete</code> command. (Citation: Technet Net Use)
2018-07-06 19:56:24 +00:00
2018-11-14 20:59:18 +00:00
Adversaries may remove share connections that are no longer useful in order to clean up traces of their operation.</blockquote>
2018-07-06 19:56:24 +00:00
## Atomic Tests
2018-09-18 10:38:22 -05:00
- [Atomic Test #1 - Add Network Share ](#atomic-test-1---add-network-share )
2018-07-06 19:56:24 +00:00
2018-09-18 10:38:22 -05:00
- [Atomic Test #2 - Remove Network Share ](#atomic-test-2---remove-network-share )
2018-07-06 19:56:24 +00:00
2018-09-18 10:38:22 -05:00
- [Atomic Test #3 - Remove Network Share PowerShell ](#atomic-test-3---remove-network-share-powershell )
2018-07-06 19:56:24 +00:00
2018-09-18 10:38:22 -05:00
<br/>
## Atomic Test #1 - Add Network Share
Add a Network Share utilizing the command_prompt
**Supported Platforms: ** Windows
#### Inputs
| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| share_name | Share to add. | string | \\test\share|
2019-09-03 13:36:10 +00:00
#### Run it with `command_prompt`!
```
2018-09-18 10:38:22 -05:00
net use c: #{share_name}
net share test=#{share_name} /REMARK:"test share" /CACHE:No
```
2019-08-30 15:42:59 +00:00
2018-09-18 10:38:22 -05:00
<br/>
2018-07-06 19:56:24 +00:00
<br/>
2018-09-18 10:38:22 -05:00
## Atomic Test #2 - Remove Network Share
2018-07-06 19:56:24 +00:00
Removes a Network Share utilizing the command_prompt
**Supported Platforms: ** Windows
#### Inputs
| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| share_name | Share to remove. | string | \\test\share|
2019-09-03 13:36:10 +00:00
#### Run it with `command_prompt`!
```
2018-07-06 19:56:24 +00:00
net share #{share_name} /delete
```
2019-08-30 15:42:59 +00:00
2018-07-06 19:56:24 +00:00
<br/>
<br/>
2018-09-18 10:38:22 -05:00
## Atomic Test #3 - Remove Network Share PowerShell
2018-07-06 19:56:24 +00:00
Removes a Network Share utilizing PowerShell
**Supported Platforms: ** Windows
#### Inputs
| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| share_name | Share to remove. | string | \\test\share|
2019-09-03 13:36:10 +00:00
#### Run it with `powershell`!
```
2018-07-06 19:56:24 +00:00
Remove-SmbShare -Name #{share_name}
Remove-FileShare -Name #{share_name}
```
2019-08-30 15:42:59 +00:00
2018-07-06 19:56:24 +00:00
<br/>