Skip to content

Commit 7ee56bf

Browse files
authored
Merge branch 'main' into tun-top-vol
2 parents f373b78 + 2b1a4ac commit 7ee56bf

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

rules/linux/persistence_systemd_netcon.toml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2024/02/01"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/02/04"
5+
updated_date = "2025/12/09"
66

77
[rule]
88
author = ["Elastic"]
@@ -61,8 +61,31 @@ type = "eql"
6161
query = '''
6262
sequence by host.id with maxspan=5s
6363
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
64-
process.parent.name == "systemd" and process.name in (
65-
"python*", "php*", "perl", "ruby", "lua*", "openssl", "nc", "netcat", "ncat", "telnet", "awk"
64+
process.parent.name == "systemd" and (
65+
process.name in (
66+
"openssl", "nc", "ncat", "netcat", "nc.openbsd", "nc.traditional", "socat", "busybox", "mkfifo",
67+
"nohup", "setsid", "xterm", "telnet", "awk"
68+
) or
69+
(process.name : "python*" and process.args : "-c" and process.args : (
70+
"*import*pty*spawn*", "*import*subprocess*call*"
71+
)) or
72+
(process.name : "perl*" and process.args : "-e" and process.args : "*socket*" and process.args : (
73+
"*exec*", "*system*"
74+
)) or
75+
(process.name : "ruby*" and process.args : ("-e", "-rsocket") and process.args : (
76+
"*TCPSocket.new*", "*TCPSocket.open*"
77+
)) or
78+
(process.name : "lua*" and process.args : "-e" and process.args : "*socket.tcp*" and process.args : (
79+
"*io.popen*", "*os.execute*"
80+
)) or
81+
(process.name : "php*" and process.args : "-r" and process.args : "*fsockopen*" and process.args : "*/bin/*sh*") or
82+
(process.name == "node" and process.args == "-e" and process.args : "*spawn*sh*" and process.args : "*connect*") or
83+
(process.name : ("awk", "gawk", "mawk", "nawk") and process.args : "*/inet/tcp/*") or
84+
(process.name in ("rvim", "vim", "vimdiff", "rview", "view") and process.args == "-c" and process.args : "*socket*")
85+
) and
86+
not (
87+
process.args in ("/usr/bin/pg_ctlcluster", "/usr/bin/pveproxy", "/usr/sbin/pveum", "/usr/bin/pveupdate") or
88+
process.executable like ("/usr/local/cpanel/*/bin/perl", "/opt/puppetlabs/puppet/bin/ruby")
6689
)
6790
] by process.entity_id
6891
[network where host.os.type == "linux" and event.action == "connection_attempted" and event.type == "start" and

rules/linux/persistence_web_server_unusual_command_execution.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/12/02"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/12/08"
5+
updated_date = "2025/12/11"
66

77
[rule]
88
author = ["Elastic"]
@@ -68,7 +68,7 @@ event.category:process and host.os.type:linux and event.type:start and event.act
6868
"apache" or "nginx" or "apache2" or "httpd" or "lighttpd" or "caddy" or "mongrel_rails" or "haproxy" or
6969
"gunicorn" or "uwsgi" or "openresty" or "cherokee" or "h2o" or "resin" or "puma" or "unicorn" or "traefik" or "uvicorn" or
7070
"tornado" or "hypercorn" or "daphne" or "twistd" or "yaws" or "webfsd" or "httpd.worker" or "flask" or "rails" or "mongrel" or
71-
php* or ruby* or perl* or python* or "node" or "java"
71+
php-fpm* or "php-cgi" or "php-fcgi" or "php-cgi.cagefs" or "java" or "node"
7272
) or
7373
user.name:("apache" or "www-data" or "httpd" or "nginx" or "lighttpd" or "tomcat" or "tomcat8" or "tomcat9") or
7474
user.id:("33" or "498" or "48" or "54321")
@@ -86,14 +86,11 @@ event.category:process and host.os.type:linux and event.type:start and event.act
8686
process.command_line:* and process.name:(bash or dash or sh or tcsh or csh or zsh or ksh or fish) and process.args:"-c" and
8787
not (
8888
(process.parent.name:java and not process.parent.executable:/u0*/*) or
89-
(process.parent.name:python* and process.parent.executable:(/bin/python* or /usr/bin/python* or /usr/local/bin/python* or /tmp/*python* or /opt/oracle.ahf/python/*)) or
90-
(process.parent.name:ruby* and process.parent.executable:(/bin/ruby* or /usr/bin/ruby* or /usr/local/bin/ruby* or /tmp/*ruby* or /bin/ruby or /usr/bin/ruby or /usr/local/bin/ruby)) or
91-
(process.parent.name:perl* and process.parent.executable:(/bin/perl* or /usr/bin/perl* or /usr/local/bin/perl* or /tmp/*perl* or /bin/perl or /usr/bin/perl or /usr/local/bin/perl)) or
92-
(process.parent.name:php* and process.parent.executable:(/bin/php* or /usr/bin/php* or /usr/local/bin/php* or /tmp/*php* or /bin/php or /usr/bin/php or /usr/local/bin/php)) or
9389
(process.parent.name:node and process.parent.executable:(/home/*/.vscode-server/* or /users/*/.vscode-server/* or /bin/node or /usr/bin/node or /usr/local/bin/node or /opt/plesk/node/*/bin/node)) or
9490
process.working_directory:(/u0*/*/sysman/emd or /u0*/app/oracle/product/*/dbhome_* or /u0*/app/oracle/product/*/db_* or /var/www/*edoc*) or
9591
process.parent.executable:/tmp/* or
96-
process.args:/usr/local/bin/wkhtmltopdf*
92+
process.args:/usr/local/bin/wkhtmltopdf* or
93+
process.parent.name:php
9794
)
9895
'''
9996

0 commit comments

Comments
 (0)