Port-relay tool invoked with a listener or SOCKS address
Matches a socat or ncat process started with an address or flag that only makes sense when the tool is bridging two connections, which is the executable half of MITRE's AN1230. The analytic pairs the tool with an uncommon outbound destination; the destination is a second event, so this rule keeps the part a single execve record can carry and gates the tool list against a relay-shaped argument rather than alerting on every invocation. MITRE's CommandLinePattern knob names socat, ncat and openssl; the address keywords listed here are authored from those tools' own syntax. The analytic also names ssh and iptables, which are left out on purpose: their forwarding flags are single letters that collide with routine administration, and a rule keyed on them would be noise rather than detection. Bare nc is left out for a different reason — Debian and Ubuntu route it through the alternatives system, so the binary auditd records is nc.openbsd or nc.traditional and an endswith on '/nc' would silently never fire. Prerequisite: auditd ships no execve rule by default, so without an explicit -a always,exit -F arch=b64 -S execve there is no process_creation telemetry on the host at all and this rule returns zero rows regardless of what ran. CommandLine is reconstructed from the a0..aN fields, and auditd hex-encodes any single argument containing whitespace; the keywords here appear inside whitespace-free arguments, so they survive that encoding, but a keyword added later might not. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0445, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Sentinel · KQL
Run this as a search.
DeviceProcessEvents| where ((FolderPath endswith "/socat" or FolderPath endswith "/ncat") and (ProcessCommandLine contains "TCP-LISTEN" or ProcessCommandLine contains "TCP4-LISTEN" or ProcessCommandLine contains "TCP6-LISTEN" or ProcessCommandLine contains "UDP-LISTEN" or ProcessCommandLine contains "OPENSSL-LISTEN" or ProcessCommandLine contains "SOCKS4" or ProcessCommandLine contains "SOCKS5" or ProcessCommandLine contains "PROXY:" or ProcessCommandLine contains "--proxy" or ProcessCommandLine contains "--broker"))
Splunk · SPL
Run this as a search.
index=* ((Image="*/socat" OR Image="*/ncat") AND (CommandLine="*TCP-LISTEN*" OR CommandLine="*TCP4-LISTEN*" OR CommandLine="*TCP6-LISTEN*" OR CommandLine="*UDP-LISTEN*" OR CommandLine="*OPENSSL-LISTEN*" OR CommandLine="*SOCKS4*" OR CommandLine="*SOCKS5*" OR CommandLine="*PROXY:*" OR CommandLine="*--proxy*" OR CommandLine="*--broker*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((TO_LOWER(process.executable) LIKE "*/socat" OR TO_LOWER(process.executable) LIKE "*/ncat") AND (TO_LOWER(process.command_line) LIKE "*tcp-listen*" OR TO_LOWER(process.command_line) LIKE "*tcp4-listen*" OR TO_LOWER(process.command_line) LIKE "*tcp6-listen*" OR TO_LOWER(process.command_line) LIKE "*udp-listen*" OR TO_LOWER(process.command_line) LIKE "*openssl-listen*" OR TO_LOWER(process.command_line) LIKE "*socks4*" OR TO_LOWER(process.command_line) LIKE "*socks5*" OR TO_LOWER(process.command_line) LIKE "*proxy:*" OR TO_LOWER(process.command_line) LIKE "*--proxy*" OR TO_LOWER(process.command_line) LIKE "*--broker*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,linux,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="7"> <!-- Set <if_sid> to the decoder/base rule for linux so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(/socat$|/ncat$)</field> <field name="CommandLine" type="pcre2">(?i)(TCP-LISTEN|TCP4-LISTEN|TCP6-LISTEN|UDP-LISTEN|OPENSSL-LISTEN|SOCKS4|SOCKS5|PROXY:|--proxy|--broker)</field> <description>Port-relay tool invoked with a listener or SOCKS address</description> <mitre> <id>T1090</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.