Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add optional field named CommandLine concat of ARGV #4

Closed
Neo23x0 opened this issue Sep 7, 2021 · 4 comments · Fixed by #20
Closed

Feature: add optional field named CommandLine concat of ARGV #4

Neo23x0 opened this issue Sep 7, 2021 · 4 comments · Fixed by #20
Labels
enhancement New feature or request

Comments

@Neo23x0
Copy link

Neo23x0 commented Sep 7, 2021

Please add a field (optional) that provides a concatenated full command line

"ARGV": ["perl", "-e", "use Socket;$i=\"10.0.0.1\";$p=1234; ...

To

"CommandLine": "perl -e use Socket;$i=\"10.0.0.1\";$p=1234; ...

e.g.

directory = "/var/log/laurel"
user = "_laurel"
concat_command_line = true

[auditlog]
file = "audit.log"
size = 1000000
generations = 10
read-users = [ "splunk" ]
@hillu hillu added the enhancement New feature or request label Sep 7, 2021
@hillu
Copy link
Collaborator

hillu commented Sep 7, 2021

We'll consider implementing this and would certainly accept pull requests (as long as the feature has to be enabled using a config option.)

Just as a note: For filtering purposes, this can be done efficiently on the SIEM side, e.g. in Splunk:

| eval cmdline=urldecode(mvjoin('EXECVE.ARGV{}', " "))

@Neo23x0
Copy link
Author

Neo23x0 commented Sep 9, 2021

An eval in splunk is a field modification that happens at search time. Most other SIEM systems index fields in the form they receive them and don't provide many or efficient methods to combine, split or modify fields at search time but perform these actions at index time. The problem with that is that this is often a custom modification of the indexer logic and differs from user to user.

Since we try to write rules that can be used by all users in the same way and the full command line is the single most important field for which we try to develop rules since day 1, a concatenated command line field would be very helpful.

@d4rk-d4nph3
Copy link

I agree with @Neo23x0 that most other SIEMs (mine too) lack functionality to combine fields at search time. For example, even in ELK you can achieve this by scripting but that is not recommended as it causes performance hit.

@AndyXan
Copy link
Collaborator

AndyXan commented Sep 9, 2021

The main reason why LAUREL exists in the first place - because even with splunk, decoding, combining (which requires for-each) on a dynamic list of a0, aX[] fields is not possible.

However, one thing to keep in mind though: Even with a joined array, For "plaintext" commandlines, urldecode is necessary - either at index or searchtime. This cannot be done by LAUREL, otherwise the transfer with json wouldn't be without information loss. And where that leads us is back to [aX=DEADBEEF].

hillu added a commit to hillu/laurel that referenced this issue Sep 21, 2021
No functional changees. This is mostly a preparation for being able to
customize behavior (see threathunters-io#4).
hillu added a commit that referenced this issue Sep 22, 2021
No functional changees. This is mostly a preparation for being able to
customize behavior (see #4).
hillu added a commit to hillu/laurel that referenced this issue Sep 24, 2021
This is disabled by default.

Close: threathunters-io#4
hillu added a commit to hillu/laurel that referenced this issue Sep 24, 2021
This is disabled by default.

Close: threathunters-io#4
hillu added a commit to hillu/laurel that referenced this issue Sep 24, 2021
The default behavior to only produce EXECVE.ARGV is unchanged.

Close: threathunters-io#4
hillu added a commit to hillu/laurel that referenced this issue Sep 24, 2021
The default behavior to only produce EXECVE.ARGV is unchanged.

Close: threathunters-io#4
hillu added a commit to hillu/laurel that referenced this issue Sep 25, 2021
The default behavior to only produce EXECVE.ARGV is unchanged.

Close: threathunters-io#4
@hillu hillu closed this as completed in #20 Sep 25, 2021
hillu added a commit that referenced this issue Sep 25, 2021
The default behavior to only produce EXECVE.ARGV is unchanged.

Close: #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants