-
Notifications
You must be signed in to change notification settings - Fork 252
Add Windows PowerShell Timeline artifact #1144
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
base: master
Are you sure you want to change the base?
Conversation
This artifact constructs a timeline of PowerShell command execution by correlating commands from ConsoleHost_History.txt with USNJRNL Data_Added events.
| query: | | ||
| LET USN_EVENTS <= SELECT | ||
| Timestamp, | ||
| split(string=OSPath, sep_string="\\")[-8] AS username, |
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.
You dont need to split here - just use OSPath[-8]
https://docs.velociraptor.app/docs/forensic/filesystem/paths/
| * | ||
| FROM PSReadline | ||
|
|
||
| LET results_with_timestamp <= SELECT * |
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.
This will be very slow. It looks like you want to do a join. See this
| WHERE CommandID = EventID | ||
| }) | ||
|
|
||
| LET PSReadline_length <= array(_={ SELECT CommandID FROM PSReadline_Indexed }).CommandID |
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.
You can just do LET PSReadline_length <= PSReadline_Indexed.CommandID
This artifact constructs a timeline of PowerShell command execution by correlating commands from ConsoleHost_History.txt with USNJRNL Data_Added events.