PowerShell
في هذه الصفحة
What PowerShell ran: script blocks, engine starts, history files and transcripts.
script_block
PowerShell script block (historical). PowerShell ran this script block on this host at the record's time, as this account (4104): a command typed, a script, or code a script built and ran. A long block is recorded in parts, each a record. Module logging (4103, and 800 in the Windows PowerShell log) records instead the commands a pipeline invoked with their parameters
Kind | Event - something that happened at a time |
Its time is | event logged |
Built-in rules reading it | 16 |
Fields of script_block
Field | Type | Meaning |
|---|---|---|
| string | The text PowerShell ran: a script block (4104) - a command typed, a script file, or code a script built and ran - or a command in a user's PowerShell history file. A long block is recorded in parts (powershell.script_part), each matched on its own: a pattern split across two parts is not found. |
| string | The script block's ID: every part of one block carries the same. |
| string | Which part of its script block a record is, "n of m" - absent for a block recorded whole. |
| string | The script file the block came from; absent for a command typed or code built at run time. |
| bool | Whether PowerShell's own check found the block suspicious (it then records it as a warning, whether or not Script Block Logging is on). The check reacts to words that administrative scripts use too; it is a hint, not a verdict. |
| string | How likely the text was written to be unreadable - medium (two of the measured indicators) or high (three or more); absent below. Measured, not matched on a word: the indicators are counts over the text (powershell.obfuscation_indicators). A packed or generated script can reach it without being malicious. |
| string | The indicators the obfuscation measure found, each with its count: backticks inside names, strings joined piece by piece, a long encoded run, a share of quotes, brackets and operators far above code's. |
| string | The account's SID - its identity across renames and hosts (a domain account has the same SID everywhere). Timeless, unlike process.pid, so it needs no companion time; the evidence types that carry it name their instances by it (evidence.Type.Identity). |
| string | What the account is: person, default (a local account Windows creates), service, virtual, anonymous, group or computer. |
powershell_engine
PowerShell engine start (historical). a Windows PowerShell engine of this version started on this host at the record's time, for this program and command line (400) - the log does not record who started it
Kind | Event - something that happened at a time |
Its time is | event logged |
Built-in rules reading it | 1 |
Fields of powershell_engine
Field | Type | Meaning |
|---|---|---|
| string | The version of the PowerShell engine that started (Windows PowerShell 400) - 2.0 is the engine that has no Script Block Logging and no AMSI. |
| string | The program, with its command line, that started the PowerShell engine (Windows PowerShell 400) - recorded whatever the 4688 command-line policy. |
| string | The PowerShell host the engine started in: ConsoleHost (a console), ServerRemoteHost (a remote session), or the name another program gives its own host. |
powershell_history
PowerShell history (in a user's history file now). this account typed this command in a PowerShell console (PSReadLine keeps it in the account's history file) - at some time between the file's creation and its last write; the file records neither when, nor whether the command succeeded
Kind | State - something true when Signal read the host |
Its time is | history file last written (the command's own time is not recorded) |
Built-in rules reading it | 16 |
Fields of powershell_history
Field | Type | Meaning |
|---|---|---|
| string | The text PowerShell ran: a script block (4104) - a command typed, a script file, or code a script built and ran - or a command in a user's PowerShell history file. A long block is recorded in parts (powershell.script_part), each matched on its own: a pattern split across two parts is not found. |
| string | The PowerShell history file a command was read from (PSReadLine's <host>_history.txt in a user's profile - one per PowerShell host, shared by Windows PowerShell and PowerShell 7). |
| time | When the command's history file was created: the earliest the command can have been typed - unless the file was copied, recreated or its times changed. |
| string | How likely the text was written to be unreadable - medium (two of the measured indicators) or high (three or more); absent below. Measured, not matched on a word: the indicators are counts over the text (powershell.obfuscation_indicators). A packed or generated script can reach it without being malicious. |
| string | The indicators the obfuscation measure found, each with its count: backticks inside names, strings joined piece by piece, a long encoded run, a share of quotes, brackets and operators far above code's. |
| string | The account's SID - its identity across renames and hosts (a domain account has the same SID everywhere). Timeless, unlike process.pid, so it needs no companion time; the evidence types that carry it name their instances by it (evidence.Type.Identity). |
| string | What the account is: person, default (a local account Windows creates), service, virtual, anonymous, group or computer. |
powershell_transcript
PowerShell transcript (in a transcript file now). a PowerShell session showed this command, as the account its transcript names - at the time its invocation header records, else between the session's start and the file's last write; the session wrote the file itself, so its header and times can be changed by whoever can write the file
Kind | State - something true when Signal read the host |
Its time is | command started (transcript header) |
Built-in rules reading it | 16 |
Fields of powershell_transcript
Field | Type | Meaning |
|---|---|---|
| string | The text PowerShell ran: a script block (4104) - a command typed, a script file, or code a script built and ran - or a command in a user's PowerShell history file. A long block is recorded in parts (powershell.script_part), each matched on its own: a pattern split across two parts is not found. |
| string | The transcript file a command was read from (PowerShell_transcript.<computer>.<random>.<time>.txt - in the policy's output folder, else in the user's Documents under a folder per day). |
| string | The account the transcript's header names (Username), and the account the session ran as when it differs (RunAs User) - as the session wrote them into its own file. |
| string | The program, with its command line, that started the PowerShell engine (Windows PowerShell 400) - recorded whatever the 4688 command-line policy. |
| string | How likely the text was written to be unreadable - medium (two of the measured indicators) or high (three or more); absent below. Measured, not matched on a word: the indicators are counts over the text (powershell.obfuscation_indicators). A packed or generated script can reach it without being malicious. |
| string | The indicators the obfuscation measure found, each with its count: backticks inside names, strings joined piece by piece, a long encoded run, a share of quotes, brackets and operators far above code's. |