Elastic medium stable eql
Potential Linux Tunneling and/or Port Forwarding
This rule monitors for a set of Linux utilities that can be used for tunneling and port forwarding. Attackers can leverage tunneling and port forwarding techniques to bypass network defenses, establish hidden communication channels, and gain unauthorized access to internal resources, facilitating data exfiltration, lateral movement, and remote control.
Detection Logic
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and (
(
// gost & pivotnacci - spawned without process.parent.name
(process.name == "gost" and process.args : ("-L*", "-C*", "-R*")) or (process.name == "pivotnacci")) or (
// ssh
(process.name == "ssh" and (
(
/* exact tunnel argument matching */
process.args in ("-R", "-L", "-D", "-w") or
/* single-dash token, first letter is NOT o/O, contains one of R/L/D/w/W somewhere later */
process.args regex "-[A-NP-Za-np-z][A-Za-z]*[RLDwW][A-Za-z]*"
) and
process.args_count >= 4 and
not (
process.args == "chmod" or process.command_line like "*rungencmd*"
)
)) or
(process.name == "ssh" and process.args == "-J") or
// sshuttle
(process.name == "sshuttle" and process.args in ("-r", "--remote", "-l", "--listen") and process.args_count >= 4) or
// socat
(process.name == "socat" and process.args : ("TCP4-LISTEN:*", "SOCKS*") and process.args_count >= 3) or
// chisel
(process.name : "chisel*" and process.args in ("client", "server")) or
// iodine(d), dnscat, hans, ptunnel-ng, ssf, 3proxy & ngrok
(process.name in ("iodine", "iodined", "dnscat", "hans", "hans-ubuntu", "ptunnel-ng", "ssf", "3proxy", "ngrok", "wstunnel"))
) and process.parent.name in ("bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")
) Field Validations
Loading…
Comments (0)
Loading comments...