Techniques
Sample rules
Linux Shell Pseudo Device Reverse Shell
- source: splunk
- technicques:
Description
The following analytic detects the use of shell’s /dev/tcp or /dev/udp pseudo-device feature to establish outbound network connections. This special file system interface allows opening a network socket and sending or receiving data using simple shell commands. Attackers commonly abuse this native shell capability to create reverse shells without requiring external tools such as netcat, by redirecting shell I/O over a TCP or UDP connection to an attacker-controlled host and port.
Detection logic
| tstats `security_content_summariesonly`
count min(_time) as firstTime
max(_time) as lastTime
from datamodel=Endpoint.Processes where
Processes.process_name IN (
"bash",
"dash",
"sh",
"zsh"
)
Processes.process IN (
"*/dev/tcp/*",
"*/dev/udp/*"
)
by Processes.process Processes.vendor_product
Processes.user_id Processes.process_hash Processes.parent_process_name Processes.parent_process_exec
Processes.action Processes.dest Processes.process_current_directory Processes.process_path
Processes.process_integrity_level Processes.original_file_name Processes.parent_process
Processes.parent_process_path Processes.parent_process_guid Processes.parent_process_id
Processes.process_guid Processes.process_id Processes.user Processes.process_name
| `drop_dm_object_name(Processes)`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
|`linux_shell_pseudo_device_reverse_shell_filter`