{
  "name": "Get-NetTcpConnection",
  "description": "Runs Get-NetTcpConnection cmdlet to find connections from the host.",
  "hosts": ["local", "remote"],
  "result_type": "connections",
  "run": {
    "command": "Get-NetTcpConnection",
    "method": "cimsession",
    "json": true,
    "result": {
      "local_address": "LocalAddress",
      "local_port": "LocalPort",
      "remote_address": "RemoteAddress",
      "remote_port": "RemotePort",
      "process": "OwningProcess",
      "state": {
        "key": "State",
        "map": {
          "2": "listen",
          "3": "syn_sent",
          "4": "syn_received",
          "5": "established",
          "6": "fin_wait_1",
          "7": "fin_wait_2",
          "8": "close_wait",
          "9": "closing",
          "10": "last_ack",
          "11": "time_wait",
          "100": "bound"
        }
      }
    }
  }
}