T1090.002

External Proxy

Adversaries may use an external proxy to act as an intermediary for network communications to a command and control server to avoid direct connections to their infrastructure. Tools like HTRAN, ZXProxy, and ZXPortMap enable traffic redirection through proxies or port redirection. External connection proxies mask the destination of C2 traffic and are typically implemented with port redirectors. Compromised systems outside the victim environment, cloud-based resources, or VPS infrastructure may be used. Victim systems communicate directly with the external proxy, which then forwards traffic to the actual C2 server.

Microsoft Sentinel / Defender
kusto
let KnownProxyTools = dynamic([
  "htran", "zxproxy", "zxportmap", "proxychains", "revsocks", "chisel",
  "frp", "frpc", "frps", "ncat", "socat", "3proxy", "shadowsocks",
  "ss-local", "privoxy", "stunnel", "iodine", "dns2tcp", "ptunnel"
]);
let SuspiciousProxyArgs = dynamic([
  "-socks", "-socks4", "-socks5", "-proxy", "socks5://", "socks4://",
  "-L ", "-R ", "-D ", "-w ", "--proxy", "-x ", "connect-proxy",
  "-N -D", "-fN -D", "-nNT -D"
]);
let SuspiciousPorts = dynamic([1080, 3128, 8080, 8888, 9050, 9051, 4444, 1337, 31337, 8443, 4443]);
// Branch 1: Known proxy tool execution
let ProxyProcesses = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (KnownProxyTools)
   or ProcessCommandLine has_any (KnownProxyTools)
   or ProcessCommandLine has_any (SuspiciousProxyArgs)
| extend DetectionReason = "Known proxy tool or argument detected"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionReason;
// Branch 2: Network connections to high proxy ports from unusual processes
let ProxyNetworkConns = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemotePort in (SuspiciousPorts)
| where RemoteIPType == "Public"
| where not (InitiatingProcessFileName in~ ("chrome.exe", "firefox.exe", "msedge.exe",
             "iexplore.exe", "opera.exe", "brave.exe", "curl.exe", "wget.exe"))
| extend DetectionReason = strcat("Outbound connection to proxy port ", RemotePort, " from ", InitiatingProcessFileName)
| project Timestamp, DeviceName,
          AccountName = InitiatingProcessAccountName,
          FileName = InitiatingProcessFileName,
          ProcessCommandLine = InitiatingProcessCommandLine,
          InitiatingProcessFileName = InitiatingProcessParentFileName,
          InitiatingProcessCommandLine = "",
          DetectionReason;
// Branch 3: SSH used as SOCKS proxy (-D flag dynamic port forwarding)
let SSHSocksProxy = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("ssh.exe", "ssh", "plink.exe")
| where ProcessCommandLine matches regex @"-[fNnqT]*D\s+\d+"
   or ProcessCommandLine has "-D " or ProcessCommandLine has "-nNT"
| extend DetectionReason = "SSH dynamic port forwarding (SOCKS proxy) detected"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionReason;
// Combine all branches
union ProxyProcesses, ProxyNetworkConns, SSHSocksProxy
| sort by Timestamp desc
high severity medium confidence

Data Sources

Process: Process Creation Network Traffic: Network Connection Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceNetworkEvents

False Positives

  • Legitimate SSH tunneling by administrators for database or management access via -D dynamic port forwarding
  • Security researchers or penetration testers using proxy tools in authorized assessments
  • Corporate proxy infrastructure where internal tools connect to a central proxy server on port 3128 or 8080
  • VPN clients or privacy tools (Tor Browser, Shadowsocks) used legitimately on endpoints where these are permitted
  • Development environments using tools like socat or chisel for local port forwarding during application testing

Unlock Pro Content

Get the full detection package for T1090.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections