Windows.Carving.Evtx
Type: Client
Carve EVTX chunks from a file or device and parse their event records.
When event logs are cleared or deleted, the old data often remains on disk until it is overwritten. This plugin scans any file or device (for example a raw volume, unallocated space, the pagefile or a memory image) for the EVTX chunk signature at any offset and parses each chunk it finds. Each 64kb chunk carries its own string and template tables, so its records can be parsed without the rest of the log file.
Required permissions: FILESYSTEM_WRITE
Precondition: SELECT OS From info() where OS = 'windows'
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Device |
string | C: |
The NTFS drive to carve |
Accessor |
string | ntfs |
The accessor to use. |
IocRegex |
regex | IOC regex - will match anywhere in the event | |
ChannelRegex |
string | . |
Channel regex to enable filtering on path |
ProviderRegex |
regex | . |
Provider regex to enable filtering on provider |
IdRegex |
regex | . |
|
DateAfter |
timestamp | search for events after this date. YYYY-MM-DDTmm:hh:ssZ | |
DateBefore |
timestamp | search for events before this date. YYYY-MM-DDTmm:hh:ssZ | |
ReconstructFile |
bool | Try to reconstruct an evtx file from the carved chunks. |
Source
Defined in artifacts/definitions/Windows/Carving/Evtx.yaml.
name: Windows.Carving.Evtx
description: |
Carve EVTX chunks from a file or device and parse their event records.
When event logs are cleared or deleted, the old data often remains
on disk until it is overwritten. This plugin scans any file or
device (for example a raw volume, unallocated space, the pagefile
or a memory image) for the EVTX chunk signature at any offset and
parses each chunk it finds. Each 64kb chunk carries its own string
and template tables, so its records can be parsed without the rest
of the log file.
required_permissions:
- FILESYSTEM_WRITE
parameters:
- name: Device
default: "C:"
description: The NTFS drive to carve
- name: Accessor
description: The accessor to use.
default: "ntfs"
- name: IocRegex
type: regex
description: "IOC regex - will match anywhere in the event"
default:
- name: ChannelRegex
description: "Channel regex to enable filtering on path"
default: .
- name: ProviderRegex
description: "Provider regex to enable filtering on provider"
default: .
type: regex
- name: IdRegex
default: .
type: regex
- name: DateAfter
type: timestamp
description: "search for events after this date. YYYY-MM-DDTmm:hh:ssZ"
- name: DateBefore
type: timestamp
description: "search for events before this date. YYYY-MM-DDTmm:hh:ssZ"
- name: ReconstructFile
type: bool
description: Try to reconstruct an evtx file from the carved chunks.
imports:
- Windows.Sys.AllUsers
precondition:
SELECT OS From info() where OS = 'windows'
sources:
- query: |
LET DateAfterTime <= DateAfter || "1600-01-01"
LET DateBeforeTime <= DateBefore || "2200-01-01"
LET S = scope()
LET Temp <= tempfile(remove_last=TRUE)
SELECT timestamp(epoch=int(int=System.TimeCreated.SystemTime)) AS EventTime,
System.Computer as Computer,
System.Channel as Channel,
System.Provider.Name as Provider,
System.EventID.Value as EventID,
System.EventRecordID as EventRecordID,
System.Security.UserID as UserSID,
LookupSIDCache(SID=System.Security.UserID || "") AS Username,
S.EventData AS EventData,
S.UserData AS UserData,
S.Message AS Message,
ChunkInfo
FROM carve_evtx(filename=Device,
accessor=Accessor,
output=if(condition=ReconstructFile, then=Temp)
)
WHERE ( EventData OR UserData OR Message )
AND EventTime < DateBeforeTime
AND EventTime > DateAfterTime
AND Channel =~ ChannelRegex
AND Provider =~ ProviderRegex
AND EventID =~ IdRegex
AND format(format='%v %v %v', args=[EventData, UserData, Message]) =~ IocRegex
- name: UploadRecostruction
query: |
SELECT upload(file=Temp) AS Upload
FROM scope()
WHERE ReconstructFile
column_types:
- name: Upload
type: upload_preview