Skip to content

Commit 6206eb6

Browse files
author
Risto Vaarandi
committed
version 2.9.0
1 parent 71c007c commit 6206eb6

4 files changed

Lines changed: 52 additions & 6 deletions

File tree

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
--- version 2.9.alpha2
1+
--- version 2.9.0
22

33
* added support for 'cmdexec', 'spawnexec', 'cspawnexec', 'pipeexec'
44
and 'reportexec' actions.

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SEC (Simple Event Correlator) 2.9.alpha2
1+
SEC (Simple Event Correlator) 2.9.0
22

33
Introduction:
44
-------------

sec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/perl -w
22
#
3-
# SEC (Simple Event Correlator) 2.9.alpha2 - sec
3+
# SEC (Simple Event Correlator) 2.9.0 - sec
44
# Copyright (C) 2000-2021 Risto Vaarandi
55
#
66
# This program is free software; you can redistribute it and/or
@@ -183,7 +183,7 @@ $WIN32 = ($^O =~ /win/i && $^O !~ /cygwin/i && $^O !~ /darwin/i);
183183

184184
# set version and usage variables
185185

186-
$SEC_VERSION = "SEC (Simple Event Correlator) 2.9.alpha2";
186+
$SEC_VERSION = "SEC (Simple Event Correlator) 2.9.0";
187187
$SEC_COPYRIGHT = "Copyright (C) 2000-2021 Risto Vaarandi";
188188

189189
$SEC_USAGE = qq!Usage: $0 [options]

sec.man

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.\"
2-
.\" SEC (Simple Event Correlator) 2.9.alpha2 - sec.man
2+
.\" SEC (Simple Event Correlator) 2.9.0 - sec.man
33
.\" Copyright (C) 2000-2021 Risto Vaarandi
44
.\"
55
.\" This program is free software; you can redistribute it and/or
@@ -16,7 +16,7 @@
1616
.\" along with this program; if not, write to the Free Software
1717
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818
.\"
19-
.TH sec 1 "April 2021" "SEC 2.9.alpha2"
19+
.TH sec 1 "May 2021" "SEC 2.9.0"
2020
.SH NAME
2121
sec \- simple event correlator
2222
.SH SYNOPSIS
@@ -5870,6 +5870,52 @@ and
58705870
actions, the program command line is not parsed by shell,
58715871
even if shell metacharacters are present in the command line.
58725872
.PP
5873+
Disabling shell parsing for command lines can be useful for avoiding unwanted
5874+
side effects. For example, consider the following badly written rule for
5875+
sending an e-mail to a local user if 10 SSH login failures have been observed
5876+
for this user from the same IP address during 300 seconds:
5877+
.PP
5878+
type=SingleWithThreshold
5879+
.br
5880+
ptype=RegExp
5881+
.br
5882+
pattern=sshd\\[\\d+\\]: Failed .+ for (.+) from ([\\d.]+) port \\d+ ssh2
5883+
.br
5884+
desc=Failed SSH logins for user $1 from $2
5885+
.br
5886+
action=pipe 'Failed SSH logins from $2' /bin/mail -s alert $1
5887+
.br
5888+
window=300
5889+
.br
5890+
thresh=10
5891+
.PP
5892+
Unfortunately, the above rule allows for the execution of arbitrary command
5893+
lines with the privileges of the SEC process.
5894+
For example, consider the following malicious command line for providing
5895+
fake input events for the rule:
5896+
.PP
5897+
logger -p authpriv.info -t sshd -i 'Failed password for `/usr/bin/touch /tmp/test` from 127.0.0.1 port 12345 ssh2'
5898+
.PP
5899+
When this command line is repeatedly executed, the attacker is able to trigger
5900+
the execution of the command line
5901+
.IR "/bin/mail -s alert `/usr/bin/touch /tmp/test`" .
5902+
However, this command line is parsed by shell that triggers the execution
5903+
of the command line specified by the attacker:
5904+
.IR "/usr/bin/touch /tmp/test" .
5905+
For fixing this issue, the
5906+
.I pipe
5907+
action can be replaced with
5908+
.I pipeexec
5909+
which will disable the shell parsing:
5910+
.PP
5911+
action=pipeexec 'Failed SSH logins from $2' /bin/mail -s alert $1
5912+
.PP
5913+
As another workaround, the regular expression pattern of the rule can be
5914+
modified to match user names that do not contain shell metacharacters,
5915+
for example:
5916+
.PP
5917+
pattern=sshd\\[\\d+\\]: Failed .+ for ([\\w.-]+) from ([\\d.]+) port \\d+ ssh2
5918+
.PP
58735919
SEC communicates with its child processes through pipes (created with the
58745920
.BR pipe (2)
58755921
system call).

0 commit comments

Comments
 (0)