Internal Proxy
Adversaries may use an internal proxy to direct command and control traffic between two or more systems in a compromised environment. Tools such as HTRAN, ZXProxy, ZXPortMap, and Cobalt Strike's peer-to-peer beacon mode enable traffic redirection through proxies or port forwarding. Adversaries use internal proxies to manage C2 communications inside a compromised environment, reduce the number of simultaneous outbound connections, provide resiliency, or ride over existing trusted communications paths between infected systems. Internal proxy connections may use common protocols such as SMB to blend in with normal traffic.
let KnownProxyTools = dynamic([
"htran", "zxproxy", "zxportmap", "lcx", "netcat", "nc.exe", "ncat",
"socat", "chisel", "ligolo", "frpc", "frps", "earthworm", "ew.exe",
"venom", "iox", "gost", "revsocks", "pivotnacci", "rpivot"
]);
let PortForwardingPatterns = dynamic([
"portproxy", "netsh interface portproxy", "netsh int portproxy",
"v4tov4", "listenport", "connectport", "connectaddress", "listenaddress",
"-L ", "-R ", "-D ", "dynamic ", "localforward", "remoteforward"
]);
let SuspiciousListenPorts = dynamic(["4444", "8888", "9999", "1080", "3128", "8080", "8443", "6666", "7777", "5555"]);
// Detection 1: Known proxy tool execution
let ProxyToolExecution = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (KnownProxyTools) or ProcessCommandLine has_any (KnownProxyTools)
| extend DetectionType = "KnownProxyTool"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Detection 2: netsh portproxy configuration
let NetshPortProxy = DeviceProcessEvents
| where Timestamp > ago(24h)
| where (FileName =~ "netsh.exe" and ProcessCommandLine has "portproxy" and ProcessCommandLine has "add")
| extend DetectionType = "NetshPortProxy"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Detection 3: SSH tunneling / port forwarding flags
let SSHTunneling = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("ssh.exe", "ssh", "plink.exe")
| where ProcessCommandLine has_any ("-L ", "-R ", "-D ", "-w ", "GatewayPorts", "AllowTcpForwarding")
| extend DetectionType = "SSHTunneling"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Detection 4: Named pipe creation for proxy (Cobalt Strike SMB beacon style)
let NamedPipeProxy = DeviceEvents
| where Timestamp > ago(24h)
| where ActionType == "NamedPipeEvent"
| where AdditionalFields has_any ("msagent_", "postex_", "mojo.", "pipe\\status_", "\\hazel", "\\msse-")
| extend DetectionType = "NamedPipeProxy"
| extend AccountName = tostring(parse_json(AdditionalFields).SubjectUserName)
| project Timestamp, DeviceName, AccountName, ActionType, AdditionalFields, DetectionType,
InitiatingProcessFileName = InitiatingProcessFileName,
InitiatingProcessCommandLine = InitiatingProcessCommandLine,
ProcessCommandLine = "";
ProxyToolExecution
| union NetshPortProxy
| union SSHTunneling
| union NamedPipeProxy
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate use of netsh portproxy by IT/network teams to redirect traffic for lab or testing environments
- SSH port forwarding by developers or DevOps teams for legitimate access to internal services (e.g., database tunneling)
- Network monitoring or vulnerability scanning tools (Nmap, Metasploit auxiliary modules) run by authorized security teams
- Reverse proxy or load balancer configuration tools executed during infrastructure provisioning
- VPN or zero-trust network access clients that use SOCKS proxies internally (e.g., Tailscale, ZScaler)
References (13)
- https://attack.mitre.org/techniques/T1090/001/
- http://blog.trendmicro.com/trendlabs-security-intelligence/in-depth-look-apt-attack-tools-of-the-trade/
- https://sygnia.co/blog/velvet-ant-espionage-campaign/
- https://research.checkpoint.com/2020/pay2key-ransomware-a-new-campaign-by-fox-kitten/
- https://media.defense.gov/2020/Aug/13/2002476465/-1/-1/0/CSA_DROVORUB_RUSSIAN_GRU_MALWARE_AUG_2020.PDF
- https://www.cobaltstrike.com/blog/cobalt-strike-peer-to-peer-c2/
- https://github.com/jpillora/chisel
- https://github.com/fatedier/frp
- https://github.com/nicocha30/ligolo-ng
- https://docs.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-interface-portproxy
- https://www.ired.team/offensive-security/lateral-movement/ssh-tunnelling-port-forwarding
- https://sygnia.co/blog/elephant-beetle-uncovering-a-years-long-espionage-campaign/
- https://www.secureworks.com/research/htran
Unlock Pro Content
Get the full detection package for T1090.001 including response playbook, investigation guide, and atomic red team tests.