Technical Tip: How to log PowerShell commands executed in interactive mode in Threat Hunting
| Description | This article describes how to log and search for PowerShell commands executed in interactive mode in Threat Hunting. |
| Scope | FortiEDR version 5.2 and above. |
| Solution | With FortiEDR, it is possible to log and search for PowerShell commands executed in interactive mode using Threat Hunting functionality.
To parse event ID 4104, configure the following:
Once the new event ID 4104 entry is generated on the device, it will be recorded in the Threat Hunting Repository and can be queried with the query: 'EventLog.EventID: ("4104")':
To filter the exact event, i.e., related to a specific security event, use the part of the command as the search condition. In the sample event network connection to the specific IP was initiated:
It is possible to filter the event log entry containing the command by using the correct event ID and destination as the conditions: 'EventLog.EventID: ("4104")' and *<destination_ip>*:
|




