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

Tweaks in how Yara scan results are reported #808

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dftimewolf/lib/collectors/grr_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class GRRYaraScanner(GRRFlow):

* {2:s}

Flow ID: `{3:s}`
Flow ID: {3:s}
"""

# pylint: disable=arguments-differ
Expand Down Expand Up @@ -546,11 +546,12 @@ def _YaraHitsToDataFrame(
'grr_client': client.client_id,
'grr_fqdn': client.data.os_info.fqdn,
'pid': process.pid,
'process': process.exe,
'username': process.username,
'cwd': process.cwd,
'rule_name': match.rule_name,
'string_matches': sorted(list(string_matches))
'string_matches': sorted(list(string_matches)),
'cmdline': ' '.join(process.cmdline),
'process': process.exe,
'cwd': process.cwd,
})
return pd.DataFrame(entries)

Expand Down
5 changes: 4 additions & 1 deletion tests/lib/collectors/grr_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ def testProcess(
'grr_fqdn': 'tomchop',
'pid': 12345,
'process': 'C:\\temp\\bad.exe',
'cmdline': 'C:\\temp\\bad.exe arg1 arg2',
'username': 'tomchop',
'cwd': 'C:\\temp',
'rule_name': 'badstring',
Expand All @@ -1067,7 +1068,9 @@ def testProcess(
{
'grr_client': 'C.0000000000000001',
'grr_fqdn': 'tomchop',
'pid': 12345, 'process': 'C:\\temp\\bad.exe',
'pid': 12345,
'process': 'C:\\temp\\bad.exe',
'cmdline': 'C:\\temp\\bad.exe arg1 arg2',
'username': 'tomchop',
'cwd': 'C:\\temp',
'rule_name': 'superbadstring',
Expand Down
1 change: 1 addition & 0 deletions tests/lib/collectors/test_data/mock_grr_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
exe='C:\\temp\\bad.exe',
username='tomchop',
cwd='C:\\temp',
cmdline=['C:\\temp\\bad.exe', 'arg1', 'arg2'],
),
match=[
flows_pb2.YaraMatch(
Expand Down
Loading