You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: elkserver/docker/redelk-logstash/redelkinstalldata/redelk-main/conf.d/51-filter-c2-cobaltstrike_logstash.conf
match => { "[c2][message]" => "(([^\s]*)) %{GREEDYDATA:[implant][task]}" }
194
172
}
195
173
196
-
# Since Cobalt Strike v3.14 the task log line contains MITRE ATT&CK numbers of the task that is about to be performed.
174
+
# The task log line can contain MITRE ATT&CK numbers of the task that is about to be performed.
197
175
# Example: [task] <T1113, T1093> Tasked beacon to take screenshot
198
-
# Here we check if '<T' and '>' are in c2.message. If so, we parse the field. If not, we assume its an old CS version and skip the creation of the ATT&CK Technique field.
176
+
# Here we check if '<T' and '>' are in c2.message. If so, we parse the field.
199
177
# We also check if there are multiple values, and if so split them up
200
178
if "<T" in [implant][task] and ">" in [implant][task] {
201
179
grok {
@@ -272,10 +250,11 @@ filter {
272
250
}
273
251
}
274
252
253
+
# Leaving this in here for legacy as screenshot logging changed in CS4.2.
275
254
# check for received screenshots and add a path value to the screenshot
match => { "[c2][message]" => "]%{GREEDYDATA:[implant][output]}" }
291
270
}
292
271
}
293
-
294
272
}
295
273
296
-
if [c2][log][type] == "keystrokes" {
297
-
# Get the timestamp from the log line, and get the rest of the log line
298
-
# Since CS version 3.14 the logging changed to include the UTC keyword
299
-
if " UTC " not in [message] { # check for legacy CS version, will be removed in the future
300
-
grok {
301
-
match => { "message" => "(?<[c2][timestamp]>%{MONTHNUM}\/%{MONTHDAY} %{TIME}) %{GREEDYDATA:[c2][message]}" }
302
-
}
303
-
# Set the timestamp from the log to @timestamp
304
-
date {
305
-
match => [ "[c2][timestamp]", "MM/dd HH:mm:ss" ]
306
-
target => "@timestamp"
307
-
timezone => "Etc/UTC"
308
-
}
309
-
} else { # check for newer version of CS, contains "UTC" in time logging lines
310
-
grok {
311
-
match => { "message" => "(?<[c2][timestamp]>%{MONTHNUM}\/%{MONTHDAY} %{TIME}) UTC %{GREEDYDATA:[c2][message]}" }
312
-
}
313
-
# Set the timestamp from the log to @timestamp
314
-
date {
315
-
match => [ "[c2][timestamp]", "MM/dd HH:mm:ss" ]
316
-
target => "@timestamp"
317
-
timezone => "Etc/UTC"
318
-
}
274
+
275
+
#
276
+
# Cobalt Strike screenshots log
277
+
# Parsed by filebeat as c2.log.type:screenshots
278
+
#
279
+
# This is for CS4.2 and later parsing of screenshot data. Since CS4.2 there is a dedicated screenshots.log file. Before CS4.2 it was parsed from regular beacon log
# In CS 4.2 the log line inside the keystroke file changed. We now have two possible matches:
312
+
# 1. 11/13 10:15:32 UTC Received keystrokes from marc in desktop 2
313
+
# 2. 10/02 11:17:31 UTC Received keystrokes - pre CS 4.2
314
+
if " from " in [c2][message] and " in desktop " in [c2][message] {
340
315
grok {
341
-
# TODO: the large int is a timestamp (in ms)
342
-
# This type of log does not have a regular timestamp, but it does have a large int at the beginning. Lets throw that away as we have no use for it now.
343
-
match => { "message" => "%{WORD}(\t)%{GREEDYDATA:[c2][message]}" }
316
+
match => { "[c2][message]" => "Received keystrokes from %{GREEDYDATA:[keystrokes][user]} in desktop %{INT:[keystrokes][desktop_session]}" }
344
317
}
345
-
grok {
346
-
match => { "[c2][message]" => "%{IP:[host][ip_int]}(\t)(?<[implant][id]>(\d{0,10}))(\t)%{INT}(\t)%{NOTSPACE:[file][directory_local]}(\t)(?<[file][name]>([^\t]*))(\t)%{GREEDYDATA:[file][directory]}" }
0 commit comments