Adversaries may attempt to get a listing of network connections to or from the compromised system they are currently accessing or from remote systems by querying for information over the network.An adversary who gains access to a system that is part of a cloud-based environment may map out Virtual Private Clouds or Virtual Networks in order to determine what systems and services are connected. The actions performed are likely the same types of discovery techniques depending on the operating system, but the resulting information may include details about the networked cloud environment relevant to the adversary's goals. Cloud providers may have different ways in which their virtual networks operate.(Citation: Amazon AWS VPC Guide)(Citation: Microsoft Azure Virtual Network Overview)(Citation: Google VPC Overview)
Utilities and commands that acquire this information include netstat, "net use," and "net session" with Net. In Mac and Linux, netstat and
lsof
can be used to list current connections.who -a
andw
can be used to show which users are currently logged in, similar to "net session".
-
Atomic Test #2 - System Network Connections Discovery with PowerShell
-
Atomic Test #3 - System Network Connections Discovery Linux & MacOS
Get a listing of network connections.
Upon successful execution, cmd.exe will execute netstat
, net use
and net sessions
. Results will output via stdout.
Supported Platforms: Windows
netstat
net use
net sessions
Get a listing of network connections.
Upon successful execution, powershell.exe will execute get-NetTCPConnection
. Results will output via stdout.
Supported Platforms: Windows
Get-NetTCPConnection
Get a listing of network connections.
Upon successful execution, sh will execute netstat
and who -a
. Results will output via stdout.
Supported Platforms: Linux, macOS
netstat
who -a
if [ -x "$(command -v netstat)" ]; then exit 0; else exit 1; fi;
echo "Install netstat on the machine."; exit 1;
Get a listing of network connections, domains, domain users, and etc.
sharpview.exe located in the bin folder, an opensource red-team tool.
Upon successful execution, cmd.exe will execute sharpview.exe . Results will output via stdout.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
SharpView_url | sharpview download URL | url | https://github.com/tevora-threat/SharpView/blob/b60456286b41bb055ee7bc2a14d645410cca9b74/Compiled/SharpView.exe?raw=true |
SharpView | Path of the executable opensource redteam tool used for the performing this atomic. | path | PathToAtomicsFolder\T1049\bin\SharpView.exe |
syntax | Arguements method used along with SharpView to get listing of network connections, domains, domain users, and etc. | String | "Invoke-ACLScanner", "Invoke-Kerberoast", "Find-DomainShare" |
$syntaxList = #{syntax}
foreach ($syntax in $syntaxList) {
#{SharpView} $syntax -}
if (Test-Path #{SharpView}) {exit 0} else {exit 1}
New-Item -Type Directory (split-path #{SharpView}) -ErrorAction ignore | Out-Null
Invoke-WebRequest #{SharpView_url} -OutFile "#{SharpView}"