-
Notifications
You must be signed in to change notification settings - Fork 481
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
Implement CLI support for filtering out rows during output #1098
Conversation
I was testing this branch trying to filter windows.pslist output by name: e.g |
Hiya, just to check |
Got it, I tested it and it works, it does resolve #1077 . |
Yep, we're not out to duplicate how we did things in vol 2, we're out to produce a properly thought out and designed system that allows people to do what they need to do. Having worked on vol 2, I think I'm allowed to say that a number of the design decisions were driven by users and speed of solution, rather than proper planning or consideration of how best to achieve the goals required. 5;) I'm glad this is useful and resolves #1077. I'm kinda of happier with this PR than with #1081 so this will probably land sooner, hopefully in a few days to give people an opportunity to test it... 5:) |
Hey @ikelos, From testing the new filtering mechanism, I believe that all plugins that support For example, the following shows
Before running the plugin, I cleared all previous files ending in .dmp. I then ran the plugin, and as can be seen, only one line of output is shown on the command line, but 49 files were produced since the filtering is just on the text output and not the operations of the plugin. Expanded to all processes, this would produce thousands of files that were not requested, wasting significant processing time and disk space, and it would also be very confusing for users. A similar, but worse, situation occurs with the dumpfiles plugin. The following invocation shows just wanting to extract mapped ntdll.dll files.
I let the plugins run for a bit and then ctrl+c to end it early. As shown, two copies of ntdll were found and shown on the command line, but 135 files in total were already extracted, and likely over a thousand would have if I let the plugin finish. Given that we have seen Windows samples from busy systems with 300-500+ processes and 1000s of cached files, having the plugins do all the extra work of processing all the data, even when the user requests only a subset, is going to break workflows for many of our users as the disk space usage and performance will be unacceptable. Particularly with one of the main benefits of Volatility 3 being the automated profile detection, many users are already taking advantage of it to mass scan dozens or hundreds of memory samples across their environment for triage. Given what you said above about "If there are specific cases where the plugin could significantly change its behaviour (reducing the time required to scan, or processing the data to carry out the filtering) then we could still add those as parameters as well as the generic UI filtering mechanism." then I think any plugin that supports --dump will need to have options for filtering inside the plugin to ensure only the requested data is worked on and extracted. The question would then be if these plugins would look for --filter options to dictate what work is done or look for other options, such as --name on its own, to decide what data to process. |
This pull request adds support for filtering columns based on the following format:
--filters [+-][columnname,]pattern[!] --filters [+-][column2,]pattern2[!]
This allows for multiple filters, each filter can specify an (optional) column name (if no column name is supplied, all columns will be checked for a match) which is case insensitive, if the column cannot be found it's treated as no column name. If the value is prefixed with a
-
rows are excluded, otherwise the pattern must be found for a row to be included.pattern
is used as a substring unless the pattern ends in!
in which case it's treated as a regular expression.Some things we could improve: