Detect Multi-hop Proxy in Elastic Security
Adversaries may chain together multiple proxies to disguise the source of malicious traffic. Techniques include Tor onion routing, ProxyChains, SOCKS proxy chaining, operational relay box (ORB) networks, and peer-to-peer routing to make attribution difficult. Defenders can typically only see the last hop before their network boundary.
MITRE ATT&CK
- Tactic
- Command and Control
- Technique
- T1090 Proxy
- Sub-technique
- T1090.003 Multi-hop Proxy
- Canonical reference
- https://attack.mitre.org/techniques/T1090/003/
Elastic Detection Query
any where
(
event.category == "process" and event.type == "start" and
(
process.name like~ ("tor.exe", "tor2web", "proxychains", "proxifier.exe", "3proxy.exe", "srelay.exe", "microsocks", "redsocks", "plink.exe")
or process.command_line like~ ("*proxychains*", "*socks5*", "*socks4*", "*tor2web*", "*DynamicForward*", "*ProxyJump*", "*ProxyCommand*")
or (
process.name like~ ("ssh", "ssh.exe", "plink.exe")
and process.command_line like~ ("* -D *", "* -J *", "* -w *", "*ProxyJump*", "*ProxyCommand*")
)
)
)
or
(
event.category == "network" and event.type in ("connection", "start") and
destination.port in (9001, 9030, 9040, 9050, 9051, 9150, 9151) and
not cidrmatch(destination.ip, "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "127.0.0.0/8", "::1/128")
) Detects T1090.003 multi-hop proxy activity via three signal classes: (1) known proxy tool process execution (Tor, ProxyChains, Proxifier, 3proxy, microsocks, redsocks, plink) matched against process.name in ECS; (2) suspicious proxy-related command-line patterns including SOCKS4/5 keywords, SSH dynamic forwarding flags (-D, -J, -w), ProxyJump, and ProxyCommand; (3) outbound network connections to well-known Tor relay ports (9001, 9030, 9040, 9050, 9051, 9150, 9151) targeting non-RFC1918 public IP space. Uses EQL any-where to correlate across process and network event categories.
Data Sources
Required Tables
False Positives & Tuning
- SSH administrators using dynamic port forwarding (-D flag) or ProxyJump (-J) chains to tunnel through authorized bastion hosts for legitimate remote network access in multi-tier architectures
- Tor Browser Bundle installed and used by journalists, researchers, or privacy-conscious employees for lawful anonymous browsing on corporate endpoints
- Authorized red team operators or penetration testers running ProxyChains, plink, or Tor relay tooling during a scoped, documented engagement on enrolled devices
Other platforms for T1090.003
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Launch Tor Process as SOCKS Proxy
Expected signal: Sysmon Event ID 1: Process Create with Image path in %TEMP%\tortest\tor\tor.exe and CommandLine containing --SocksPort 9050. Sysmon Event ID 3: Multiple outbound TCP connections to public IPs on ports 9001 and 9030 (Tor directory and guard connections). Sysmon Event ID 11: File creation events for tor.exe and torrc in non-standard temp path.
- Test 2ProxyChains Multi-hop Configuration and Execution
Expected signal: Linux auditd/syslog: Process creation for proxychains4 with command line referencing the config file. Sysmon for Linux (if deployed) Event ID 1: Process Create for proxychains4 with full command line. Network connection attempts through the configured SOCKS chain. File creation event for /tmp/test_proxychains.conf.
- Test 3SSH Dynamic Port Forwarding (Multi-hop SOCKS Proxy)
Expected signal: Sysmon Event ID 1 (Linux) or Security Event ID 4688 (Windows with OpenSSH): Process Create for ssh with CommandLine containing '-D 1080' or '-J jumphost.example.com'. Sysmon Event ID 3: Outbound TCP connection to 192.0.2.1:22 and jumphost.example.com:22. The -D flag creates a listening socket on local port 1080 visible in netstat/socket monitoring.
- Test 4SOCKS Proxy via Netcat/Ncat Relay Chain Simulation
Expected signal: Sysmon Event ID 1: Multiple ncat.exe or nc.exe process creation events with -l (listen) and -c (command/forward) flags. Sysmon Event ID 3: Network listen and connection events on ports 18080 and 18081. Security Event ID 4688 (if command line auditing enabled): ncat.exe process creation with forwarding arguments.
References (12)
- https://attack.mitre.org/techniques/T1090/003/
- https://en.wikipedia.org/wiki/Onion_routing
- https://cloud.google.com/blog/topics/threat-intelligence/china-nexus-espionage-orb-networks
- https://unit42.paloaltonetworks.com/manageengine-godzilla-nglite-kdcsponge/
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa21-200a
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-129a
- https://www.welivesecurity.com/2018/10/17/greyenergy-updated-arsenal-dangerous-threat-actors/
- https://www.torproject.org/about/history/
- https://github.com/rofl0r/proxychains-ng
- https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1090.003/T1090.003.md
Unlock Pro Content
Get the full detection package for T1090.003 including response playbook, investigation guide, and atomic red team tests.