-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add specialized parsing to powershell classic events
Fixes: #32
- Loading branch information
Showing
5 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"System": { | ||
"Provider": { | ||
"Name": "PowerShell" | ||
}, | ||
"EventID": { | ||
"Qualifiers": 0, | ||
"Value": 400 | ||
}, | ||
"Version": 0, | ||
"Level": 4, | ||
"Task": 6, | ||
"Opcode": 0, | ||
"Keywords": 36028797018963970, | ||
"TimeCreated": { | ||
"SystemTime": 1705127155.1681073 | ||
}, | ||
"EventRecordID": 1, | ||
"Correlation": {}, | ||
"Execution": { | ||
"ProcessID": 0, | ||
"ThreadID": 0 | ||
}, | ||
"Channel": "Windows PowerShell", | ||
"Computer": "WIN-2VKA2DK38DT", | ||
"Security": {} | ||
}, | ||
"EventData": { | ||
"Data": [ | ||
"Registry", | ||
"Started", | ||
"\tProviderName=Registry\r\n\tNewProviderState=Started\r\n\r\n\tSequenceNumber=1\r\n\r\n\tHostName=ConsoleHost\r\n\tHostVersion=5.1.20348.558\r\n\tHostId=1cfcf98e-3a81-443f-91bf-cdc325c0ed3d\r\n\tHostApplication=powershell.exe\r\n\tEngineVersion=\r\n\tRunspaceId=\r\n\tPipelineId=\r\n\tCommandName=\r\n\tCommandType=\r\n\tScriptName=\r\n\tCommandPath=\r\n\tCommandLine=" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Parameters: | ||
fixture: /testcases/fixtures/powershell_classic.json | ||
|
||
Queries: | ||
- LET _ <= SELECT mock(plugin='parse_evtx', results=[parse_json(data=read_file(filename=testDir+ fixture)),]) FROM scope() | ||
|
||
# Check for Details field working correctly - the log source should | ||
# extract the HostApplication field. | ||
- SELECT * FROM Artifact.Windows.Hayabusa.Rules( | ||
RuleStatus='All Rules', RuleLevel='All', RuleTitleFilter="PwSh Engine Started") | ||
LIMIT 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
LET _ <= SELECT mock(plugin='parse_evtx', results=[parse_json(data=read_file(filename=testDir+ fixture)),]) FROM scope()[]SELECT * FROM Artifact.Windows.Hayabusa.Rules( RuleStatus='All Rules', RuleLevel='All', RuleTitleFilter="PwSh Engine Started") LIMIT 1[ | ||
{ | ||
"Timestamp": "2024-01-13T06:25:55.168107271Z", | ||
"Computer": "WIN-2VKA2DK38DT", | ||
"Channel": "Windows PowerShell", | ||
"EID": 400, | ||
"Level": "informational", | ||
"Title": "PwSh Engine Started", | ||
"RecordID": 1, | ||
"Details": "HostApplication: powershell.exe", | ||
"_Event": { | ||
"System": { | ||
"Provider": { | ||
"Name": "PowerShell" | ||
}, | ||
"EventID": { | ||
"Qualifiers": 0, | ||
"Value": 400 | ||
}, | ||
"Version": 0, | ||
"Level": 4, | ||
"Task": 6, | ||
"Opcode": 0, | ||
"Keywords": 36028797018963970, | ||
"TimeCreated": { | ||
"SystemTime": 1705127155.1681073 | ||
}, | ||
"EventRecordID": 1, | ||
"Correlation": {}, | ||
"Execution": { | ||
"ProcessID": 0, | ||
"ThreadID": 0 | ||
}, | ||
"Channel": "Windows PowerShell", | ||
"Computer": "WIN-2VKA2DK38DT", | ||
"Security": {} | ||
}, | ||
"EventData": { | ||
"Data": "\tProviderName=Registry\r\n\tNewProviderState=Started\r\n\r\n\tSequenceNumber=1\r\n\r\n\tHostName=ConsoleHost\r\n\tHostVersion=5.1.20348.558\r\n\tHostId=1cfcf98e-3a81-443f-91bf-cdc325c0ed3d\r\n\tHostApplication=powershell.exe\r\n\tEngineVersion=\r\n\tRunspaceId=\r\n\tPipelineId=\r\n\tCommandName=\r\n\tCommandType=\r\n\tScriptName=\r\n\tCommandPath=\r\n\tCommandLine=", | ||
"HostApplication": "powershell.exe" | ||
}, | ||
"Message": null | ||
}, | ||
"_Source": "Windows.Hayabusa.Rules" | ||
} | ||
] |