Format of EXECVE
Firstly, on RHEL4 U5, I've noticed that if an argument has spaces in it, it won't be pretty printed in the EXECVE record. E.g.:
# /bin/echo foo EXECVE... argv[1]="foo"
# /bin/echo "foo bar" EXECVE... argv[1]=1234ABCD
Is that a feature?
Secondly, I noticed that the sequence of messages is:
SYSCALL
EXECVE
CWD
PATH
I'm considering expanding argv[0] of EXECVE to be an absolute path. However, that would mean either buffering things or moving EXECVE after the PATH record. Would that break any contract, or reasonable expectations that anyone's aware of?
Thanks,
Matt
Signature · 6 lines
Matthew Booth, RHCA, RHCSS Red Hat, Global Professional Services M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
Quoted 2 lines · On Monday 17 September 2007 12:50:16 Matthew Booth wrote:
Firstly, on RHEL4 U5, I've noticed that if an argument has spaces in it, it won't be pretty printed in the EXECVE record. Is that a feature?
Yes. Any field originating in something that a user can alter is escaped when one of several characters is found in the field.
Quoted 10 lines
Secondly, I noticed that the sequence of messages is:
SYSCALL
EXECVE
CWD
PATHI'm considering expanding argv[0] of EXECVE to be an absolute path. However, that would mean either buffering things or moving EXECVE after the PATH record. Would that break any contract, or reasonable expectations that anyone's aware of?
They come out in the order the kernel creates them. I don't think anything in the audit package cares about that ordering. It buffers an event at a time in ausearch and aureport.
-Steve
Quoted 1 line · Matthew Booth
I'm considering expanding argv[0] of EXECVE to be an absolute path.
I take it you mean "*an* absolute path that was valid when we cut the EXECVE record", and document that it may not be *the* actual path used? In a quarter century, I've just seen *too* many race conditions, tricks with ../symlink/foo links, and the like (including some interesting malware that would dynamically create a symlink and execve through it, just to frustrate attempts at figuring out which binary was being exploited).
Quoted 10 lines · On Mon, 2007-09-17 at 16:54 -0400, [email protected] wrote:
Quoted 1 line · Matthew Booth
I'm considering expanding argv[0] of EXECVE to be an absolute path.
I take it you mean "*an* absolute path that was valid when we cut the EXECVE record", and document that it may not be *the* actual path used? In a quarter century, I've just seen *too* many race conditions, tricks with ../symlink/foo links, and the like (including some interesting malware that would dynamically create a symlink and execve through it, just to frustrate attempts at figuring out which binary was being exploited).
This would be an issue in a single-pronged approach.
Matt
Signature · 6 lines
Matthew Booth, RHCA, RHCSS Red Hat, Global Professional Services M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490