-
Notifications
You must be signed in to change notification settings - Fork 71
Add Rapid7 Velociraptor artifacts plugin #698
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
Conversation
|
I have a few questions:
|
Will be fixed in another PR
|
@Schamper, I am trying to map files into a different location so that these files can be used by plugins.
The function |
|
@EinatFox can somebody take a look at this PR? I don't know if the code that I want to implement will even work. |
|
@Schamper any response? |
|
Hi @Zawadidone and sorry for the late response. As we are very low on resources and this has low priority for us internally, I cannot allocated resources for this soon. However, we understand the value for the community. Let's connect in January to see how we can help you finalize this PR submission. |
Schamper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also move acquire_hash.py and acquire_handles.py into a single plugins/apps/edr/acquire.py and make it a namespace? acquire.hashes and acquire.handles sounds nice.
…issect.target into feature/velociraptor_plugin
|
This is not blocking but the function Is this normal behaviour of the filesystem? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #698 +/- ##
==========================================
+ Coverage 77.84% 77.86% +0.01%
==========================================
Files 357 357
Lines 32367 32435 +68
==========================================
+ Hits 25196 25255 +59
- Misses 7171 7180 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Do you have a full stacktrace or otherwise a small reproducible snippet? I'm not really sure what you mean from just this description. |
|
Listing the files with the function I am curious whether this a bug in the filesystem implementation of Dissect or related to the implementation of the diff --git i/dissect/target/plugins/apps/edr/velociraptor.py w/dissect/target/plugins/apps/edr/velociraptor.py
index 0a6250f9..08b96445 100644
--- i/dissect/target/plugins/apps/edr/velociraptor.py
+++ w/dissect/target/plugins/apps/edr/velociraptor.py
@@ -81,10 +81,7 @@ class VelociraptorPlugin(Plugin):
References:
- https://docs.velociraptor.app/docs/vql/artifacts/
"""
- for artifact in self.results.iterdir():
- if not artifact.name.endswith(".json"):
- continue
-
+ for artifact in self.results.glob("*.json"):
# "Windows.KapeFiles.Targets%2FAll\ File\ Metadata.json" becomes "windows_kapefiles_targets"
artifact_name = (
urllib.parse.unquote(artifact.name.removesuffix(".json")).split("/")[0].lower().replace(".", "_")Traceback (most recent call last):
File /dissect.target/dissect/target/helpers/compat/path_310.py", line 261, in get
return self._entry
AttributeError: 'TargetPath' object has no attribute '_entry'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/dissect.target/.tox/py310/bin/target-query", line 8, in <module>
sys.exit(main())
File "/dissect.target/dissect/target/tools/utils.py", line 249, in wrapper
return func(*args, **kwargs)
File "/dissect.target/dissect/target/tools/query.py", line 386, in main
for record in record_generator:
File "/dissect.target/dissect/target/plugins/apps/edr/velociraptor.py", line 97, in velociraptor
for line in artifact.open("rt"):
File "/dissect.target/dissect/target/helpers/compat/path_310.py", line 391, in open
return self._accessor.open(self, mode, buffering, encoding, errors, newline)
File "/dissect.target/dissect/target/helpers/compat/path_310.py", line 91, in open
return path_common.io_open(path, mode, buffering, encoding, errors, newline)
File "/dissect.target/dissect/target/helpers/compat/path_common.py", line 216, in io_open
raw = path.get().open()
File "/dissect.target/dissect/target/helpers/compat/path_310.py", line 263, in get
self._entry = self._fs.get(str(self))
File "/dissect.target/dissect/target/filesystem.py", line 1628, in get
entry = super().get(path, relentry)
File "dissect.target/dissect/target/filesystem.py", line 1479, in get
raise FileNotFoundError(full_path)
dissect.target.exceptions.FileNotFoundError: /$velociraptor_results$/Windows.Network.NetstatEnriched%2FNetstat.json |
|
I can't reproduce, should the unit test trigger this already? I made some small other changes but I don't think those should affect this. |
|
The unit tests are not affected and the error occurred when using When using a virtual file system the issue does not occur, so the commit |
|
Weird, but okay. If you address that last comment then this is good to go. |
…issect.target into feature/velociraptor_plugin
Adds support for Velociraptor artifacts: https://docs.velociraptor.app/docs/vql/artifacts/.