Documentation
¶
Index ¶
- Constants
- Variables
- func BackupSeeker(seeker io.Seeker) int64
- func DebugReader(reader io.ReadSeeker, before, after int64)
- func GoToSeeker(seeker io.Seeker, offset int64)
- func ReadSeekerSize(reader io.ReadSeeker) int64
- func RelGoToSeeker(seeker io.Seeker, offset int64)
- func SetDebug(value bool)
- func SetMaxJobs(jobs int)
- func SetModeCarving(value bool)
- func SetMonitorSleep(d time.Duration)
- func ToJSON(data interface{}) []byte
- func UpdateLastElements(e Element)
- type AnsiString
- type Attribute
- type AttributeData
- type AttributeList
- type BinXMLCloseEmptyElementTag
- type BinXMLCloseStartElementTag
- type BinXMLEOF
- type BinXMLEndElementTag
- type BinXMLEntityReference
- type CDATASection
- type CharEntityRef
- type Chunk
- func (c *Chunk) Events() (cgem chan *GoEvtxMap)
- func (c Chunk) Less(s *datastructs.Sortable) bool
- func (c *Chunk) ParseChunkHeader(reader io.ReadSeeker)
- func (c *Chunk) ParseEvent(offset int64) (e Event)
- func (c *Chunk) ParseEventOffsets(reader io.ReadSeeker) (err error)
- func (c *Chunk) ParseStringTable(reader io.ReadSeeker)
- func (c *Chunk) ParseTemplateTable(reader io.ReadSeeker) error
- func (c Chunk) String() string
- type ChunkCache
- type ChunkHeader
- type ChunkSorter
- type ChunkString
- type ChunkStringTable
- type Content
- type ContentStringData
- type Element
- type ElementStart
- type EmptyElement
- type EntityReference
- type ErrEvtxEltNotFound
- type ErrUnknownToken
- type Event
- type EventHeader
- type EventIDType
- type File
- func (ef *File) Chunks() (cc chan Chunk)
- func (ef *File) Close() error
- func (ef *File) Events() (cgem chan *GoEvtxMap)
- func (ef *File) FastEvents() (cgem chan *GoEvtxMap)
- func (ef *File) FetchChunk(offset int64) (Chunk, error)
- func (ef *File) FetchRawChunk(offset int64) (Chunk, error)
- func (ef *File) MonitorEvents(stop chan bool, sleep ...time.Duration) (cgem chan *GoEvtxMap)
- func (ef *File) ParseFileHeader()
- func (ef *File) SetMonitorExisting(value bool)
- func (ef *File) UnorderedChunks() (cc chan Chunk)
- func (ef *File) UnorderedEvents() (cgem chan *GoEvtxMap)
- type FileHeader
- type FileTime
- type Fragment
- type FragmentHeader
- type GUID
- type GoEvtxElement
- type GoEvtxMap
- func (pg *GoEvtxMap) Add(other GoEvtxMap)
- func (pg *GoEvtxMap) After(t time.Time) bool
- func (pg *GoEvtxMap) AnyEqual(path *GoEvtxPath, is []interface{}) bool
- func (pg *GoEvtxMap) At(t time.Time) bool
- func (pg *GoEvtxMap) Before(t time.Time) bool
- func (pg *GoEvtxMap) Between(t1, t2 time.Time) bool
- func (pg *GoEvtxMap) Channel() string
- func (pg *GoEvtxMap) Del(path *GoEvtxPath)
- func (pg *GoEvtxMap) DelXmlns()
- func (pg *GoEvtxMap) Equal(path *GoEvtxPath, i interface{}) bool
- func (pg *GoEvtxMap) EventID() int64
- func (pg *GoEvtxMap) EventRecordID() int64
- func (pg *GoEvtxMap) Get(path *GoEvtxPath) (*GoEvtxElement, error)
- func (pg *GoEvtxMap) GetBool(path *GoEvtxPath) (bool, error)
- func (pg *GoEvtxMap) GetBoolStrict(path *GoEvtxPath) bool
- func (pg *GoEvtxMap) GetInt(path *GoEvtxPath) (int64, error)
- func (pg *GoEvtxMap) GetIntStrict(path *GoEvtxPath) int64
- func (pg *GoEvtxMap) GetMap(path *GoEvtxPath) (*GoEvtxMap, error)
- func (pg *GoEvtxMap) GetMapStrict(path *GoEvtxPath) *GoEvtxMap
- func (pg *GoEvtxMap) GetMapWhere(path *GoEvtxPath, value interface{}) (*GoEvtxMap, error)
- func (pg *GoEvtxMap) GetMapWhereStrict(path *GoEvtxPath, value interface{}) *GoEvtxMap
- func (pg *GoEvtxMap) GetStrict(path *GoEvtxPath) *GoEvtxElement
- func (pg *GoEvtxMap) GetString(path *GoEvtxPath) (string, error)
- func (pg *GoEvtxMap) GetStringStrict(path *GoEvtxPath) string
- func (pg *GoEvtxMap) GetTime(path *GoEvtxPath) (time.Time, error)
- func (pg *GoEvtxMap) GetTimeStrict(path *GoEvtxPath) time.Time
- func (pg *GoEvtxMap) GetUint(path *GoEvtxPath) (uint64, error)
- func (pg *GoEvtxMap) GetUintStrict(path *GoEvtxPath) uint64
- func (pg *GoEvtxMap) HasKeys(keys ...string) bool
- func (pg *GoEvtxMap) IsEventID(eids ...interface{}) bool
- func (pg *GoEvtxMap) RegexMatch(path *GoEvtxPath, pattern *regexp.Regexp) bool
- func (pg *GoEvtxMap) Set(path *GoEvtxPath, new GoEvtxElement) error
- func (pg *GoEvtxMap) TimeCreated() time.Time
- func (pg *GoEvtxMap) UserID() (userID string, ok bool)
- type GoEvtxPath
- type Name
- type Node
- type NormalSubstitution
- type OptionalSubstitution
- type PI
- type PIData
- type PITarget
- type Sid
- type Substitution
- type SysTime
- type TemplateDefinition
- type TemplateDefinitionData
- type TemplateDefinitionHeader
- type TemplateInstance
- func (ti *TemplateInstance) DataOffset(reader io.ReadSeeker) (offset int32, err error)
- func (ti *TemplateInstance) ElementToGoEvtx(elt Element) GoEvtxElement
- func (ti *TemplateInstance) GoEvtxMap() *GoEvtxMap
- func (ti *TemplateInstance) NodeToGoEvtx(n *Node) GoEvtxMap
- func (ti *TemplateInstance) Parse(reader io.ReadSeeker) error
- func (ti *TemplateInstance) ParseTemplateDefinitionHeader(reader io.ReadSeeker) error
- func (ti *TemplateInstance) Root() Node
- func (ti TemplateInstance) String() string
- type TemplateInstanceData
- type TemplateTable
- type Token
- type UTCTime
- type UTF16
- type UTF16String
- type UnicodeTextString
- type UnkVal
- type Value
- type ValueArrayUInt16
- type ValueArrayUInt64
- type ValueBinary
- type ValueBool
- type ValueData
- type ValueDescriptor
- type ValueFileTime
- type ValueGUID
- type ValueHexInt32
- type ValueHexInt64
- type ValueInt16
- type ValueInt32
- type ValueInt64
- type ValueInt8
- type ValueNull
- type ValueReal32
- type ValueReal64
- type ValueSID
- type ValueString
- type ValueStringTable
- type ValueSysTime
- type ValueText
- type ValueType
- type ValueUInt16
- type ValueUInt32
- type ValueUInt64
- type ValueUInt8
Constants ¶
const ( EventHeaderSize = 24 EvtxMagic = "ElfFile" // ChunkSize 64KB ChunkSize = 0x10000 // ChunkHeaderSize ChunkHeaderSize = 0x80 // ChunkMagic magic string ChunkMagic = "ElfChnk\x00" DefaultNameOffset = -1 EventMagic = "\x2a\x2a\x00\x00" // MaxSliceSize is a constant used to control the allocation size of some // structures. It is particularly useful to control side effect when carving MaxSliceSize = ChunkSize )
const ( TokenEOF = 0x00 TokenOpenStartElementTag1, TokenOpenStartElementTag2 = 0x01, 0x41 // (<)name> TokenCloseStartElementTag = 0x02 // <name(>) TokenCloseEmptyElementTag = 0x03 // <name(/>) TokenEndElementTag = 0x04 // (</name>) TokenValue1, TokenValue2 = 0x05, 0x45 // attribute = ‘‘(value)’’ TokenAttribute1, TokenAttribute2 = 0x06, 0x46 // (attribute) = ‘‘value’’ TokenCDataSection1, TokenCDataSection2 = 0x07, 0x47 TokenCharRef1, TokenCharRef2 = 0x08, 0x48 TokenEntityRef1, TokenEntityRef2 = 0x09, 0x49 TokenPITarget = 0x0a TokenPIData = 0x0b TokenTemplateInstance = 0x0c TokenNormalSubstitution = 0x0d TokenOptionalSubstitution = 0x0e FragmentHeaderToken = 0x0f )
const ( NullType = 0x00 StringType = 0x01 AnsiStringType = 0x02 Int8Type = 0x03 UInt8Type = 0x04 Int16Type = 0x05 UInt16Type = 0x06 Int32Type = 0x07 UInt32Type = 0x08 Int64Type = 0x09 UInt64Type = 0x0a Real32Type = 0x0b Real64Type = 0x0c BoolType = 0x0d BinaryType = 0x0e GuidType = 0x0f SizeTType = 0x10 FileTimeType = 0x11 SysTimeType = 0x12 SidType = 0x13 HexInt32Type = 0x14 HexInt64Type = 0x15 EvtHandle = 0x20 BinXmlType = 0x21 EvtXml = 0x23 // If the MSB of the value type (0x80) is use to indicate an array type ArrayType = 0x80 )
Variables ¶
var ( ErrCorruptedHeader = fmt.Errorf("Corrupted header") ErrDirtyFile = fmt.Errorf("File is flagged as dirty") ErrRepairFailed = fmt.Errorf("File header could not be repaired") )
var ( ErrInvalidEvent = errors.New("Error Invalid Event") // ErrBadEvtxFile error definition ErrBadEvtxFile = errors.New("Bad file magic") // ErrBadChunkMagic error definition ErrBadChunkMagic = errors.New("Bad chunk magic") // ErrBadChunkSize error definition ErrBadChunkSize = errors.New("Bad chunk size") ErrTokenEOF = errors.New("TokenEOF") )
var ( // Debug mode for parser Debug = false // ModeCarving flag to identify we run in carving mode ModeCarving = false // DefaultMonitorSleep default sleep time between two file update checks when // monitoring file DefaultMonitorSleep = 250 * time.Millisecond // MaxJobs controls the maximum jobs for some functions (MonitorEvents ...) MaxJobs = int(math.Floor(float64(runtime.NumCPU()) / 2)) )
////////////////////// Global Variables and their setters /////////////////////
var ( // Paths used by GoEvtxMap PathSeparator = "/" XmlnsPath = Path("/Event/xmlns") ChannelPath = Path("/Event/System/Channel") EventIDPath = Path("/Event/System/EventID") EventIDPath2 = Path("/Event/System/EventID/Value") EventRecordIDPath = Path("/Event/System/EventRecordID") SystemTimePath = Path("/Event/System/TimeCreated/SystemTime") UserIDPath = Path("/Event/System/Security/UserID") )
var (
Endianness = binary.LittleEndian
)
var (
UTF16EndOfString = uint16(0x0)
)
Functions ¶
func BackupSeeker ¶
func DebugReader ¶
func DebugReader(reader io.ReadSeeker, before, after int64)
func GoToSeeker ¶
func ReadSeekerSize ¶
func ReadSeekerSize(reader io.ReadSeeker) int64
func RelGoToSeeker ¶
func SetDebug ¶ added in v1.2.5
func SetDebug(value bool)
SetDebug set variable enabling debugging at parser level
func SetModeCarving ¶
func SetModeCarving(value bool)
SetModeCarving changes the carving mode to value
func SetMonitorSleep ¶
SetMonitorSleep sets the sleep time between two file update checks when monitoring file
func UpdateLastElements ¶
func UpdateLastElements(e Element)
Types ¶
type AnsiString ¶
type AnsiString struct { Size uint16 // contains filtered or unexported fields }
func (*AnsiString) Parse ¶
func (as *AnsiString) Parse(reader io.ReadSeeker) error
func (*AnsiString) Repr ¶
func (as *AnsiString) Repr() interface{}
func (*AnsiString) String ¶
func (as *AnsiString) String() string
func (*AnsiString) Value ¶
func (as *AnsiString) Value() interface{}
type Attribute ¶
type AttributeData ¶
type AttributeList ¶
func (*AttributeList) Parse ¶
func (al *AttributeList) Parse(reader io.ReadSeeker) error
func (*AttributeList) ParseAttributes ¶
func (al *AttributeList) ParseAttributes(reader io.ReadSeeker) error
func (*AttributeList) ParseSize ¶
func (al *AttributeList) ParseSize(reader io.ReadSeeker) error
type BinXMLCloseEmptyElementTag ¶
type BinXMLCloseEmptyElementTag struct {
Token
}
type BinXMLCloseStartElementTag ¶
type BinXMLCloseStartElementTag struct {
Token
}
type BinXMLEndElementTag ¶
type BinXMLEndElementTag struct { //Token int8 Token }
type BinXMLEntityReference ¶
BinXMLEntityReference implementation
func (*BinXMLEntityReference) Parse ¶
func (e *BinXMLEntityReference) Parse(reader io.ReadSeeker) error
Parse implements Element
func (*BinXMLEntityReference) String ¶
func (e *BinXMLEntityReference) String() string
type CDATASection ¶
type CDATASection struct { Token int8 Text UnicodeTextString }
CDATASection : BinXmlCDATASection
type CharEntityRef ¶
func (*CharEntityRef) Parse ¶
func (cer *CharEntityRef) Parse(reader io.ReadSeeker) error
type Chunk ¶
type Chunk struct { Offset int64 Header ChunkHeader StringTable ChunkStringTable TemplateTable TemplateTable EventOffsets []int32 Data []byte }
Chunk structure definition
func NewChunk ¶
func NewChunk() Chunk
NewChunk initialize and returns a new Chunk structure return Chunk
func (Chunk) Less ¶
func (c Chunk) Less(s *datastructs.Sortable) bool
Less implement datastructs.Sortable
func (*Chunk) ParseChunkHeader ¶
func (c *Chunk) ParseChunkHeader(reader io.ReadSeeker)
ParseChunkHeader parses a chunk header at offset
func (*Chunk) ParseEvent ¶
ParseEvent parses an Event from the current chunk located at the relative offset in c.Data, does not alter the current Chunk structure @offset : offset to parse the Event at return Event : parsed Event
func (*Chunk) ParseEventOffsets ¶
func (c *Chunk) ParseEventOffsets(reader io.ReadSeeker) (err error)
ParseEventOffsets parses the offsets at which we can find the events and modifies the current Chunk object @reader : reader object to parse event offsets from
func (*Chunk) ParseStringTable ¶
func (c *Chunk) ParseStringTable(reader io.ReadSeeker)
ParseStringTable parses the string table located at the current offset in the reader and modify the chunk object @reader : reader object to parse string table from
func (*Chunk) ParseTemplateTable ¶
func (c *Chunk) ParseTemplateTable(reader io.ReadSeeker) error
ParseTemplaTable parses the template table located at the current offset in the reader passed as parameter and modifies the current Chunk object @reader : reader object to parse string table from
type ChunkHeader ¶
type ChunkHeader struct { Magic [8]byte NumFirstRecLog int64 NumLastRecLog int64 FirstEventRecID int64 LastEventRecID int64 SizeHeader int32 OffsetLastRec int32 Freespace int32 CheckSum uint32 }
ChunkHeader structure definition
func (ChunkHeader) String ¶
func (ch ChunkHeader) String() string
func (*ChunkHeader) Validate ¶
func (ch *ChunkHeader) Validate() error
Validate controls the validity of the chunk header
type ChunkSorter ¶
type ChunkSorter []Chunk
ChunkSorter structure used to sort chunks before parsing the events inside prevent unordered events
type ChunkString ¶
type ChunkString struct {
Name
}
ChunkString is similare to BinXMLName
func StringAt ¶
func StringAt(reader io.ReadSeeker, offset int64) (cs ChunkString, err error)
StringAt : utility function to get a ChunkString object at a given offset @reader : reader containing ChunkString struct @ offset @offset : offset at which we find the ChunkString return ChunkString
type ContentStringData ¶
type ContentStringData interface { }
type Element ¶
type Element interface {
Parse(reader io.ReadSeeker) error
}
func Parse ¶
Parse : parses an XMLElement from a reader object @reader : reader to parse the Element from @c : chunk pointer used for already parsed templates return (Element, error) : parsed XMLElement and error
func ParseValueReader ¶
func ParseValueReader(vd ValueDescriptor, reader io.ReadSeeker) (Element, error)
ParseValueReader : Parse a value from a reader according to a ValueDescriptor @vd : a ValueDescriptor structure @reader : the reader position at the offset of the value that have to be parsed return (Element, error) : a XMLElement and error
type ElementStart ¶
type ElementStart struct { Offset int64 IsTemplateInstance bool Token int8 DepID int16 Size int32 NameOffset int32 // relative to start of chunk Name Name AttributeList AttributeList EOESToken uint8 }
ElementStart : BinXMLElementStart
func (*ElementStart) HasName ¶
func (es *ElementStart) HasName() bool
func (*ElementStart) Parse ¶
func (es *ElementStart) Parse(reader io.ReadSeeker) (err error)
func (ElementStart) String ¶
func (es ElementStart) String() string
type EmptyElement ¶
type EmptyElement struct{}
func (EmptyElement) Parse ¶
func (EmptyElement) Parse(reader io.ReadSeeker) error
type EntityReference ¶
EntityReference : BinXmlEntityReference
type ErrEvtxEltNotFound ¶
type ErrEvtxEltNotFound struct {
// contains filtered or unexported fields
}
func (*ErrEvtxEltNotFound) Error ¶
func (e *ErrEvtxEltNotFound) Error() string
type ErrUnknownToken ¶
type ErrUnknownToken struct {
Token uint8
}
func (ErrUnknownToken) Error ¶
func (e ErrUnknownToken) Error() string
type Event ¶
type Event struct { Offset int64 // For debugging purposes Header EventHeader }
Event structure
func (Event) GoEvtxMap ¶
GoEvtxMap parses the BinXML inside the event and returns a pointer to a structure GoEvtxMap @c : chunk pointer used for template data already parsed return (*GoEvtxMap, error)
type EventHeader ¶
func (*EventHeader) Validate ¶
func (h *EventHeader) Validate() error
Validate controls the EventHeader
type File ¶
type File struct { sync.Mutex // We need it if we want to parse (read) chunks in several threads Header FileHeader // contains filtered or unexported fields }
File structure definition
func New ¶
func New(r io.ReadSeeker) (ef File, err error)
New EvtxFile structure initialized from an open buffer @r : buffer containing evtx data to parse return File : File structure initialized
func Open ¶
New EvtxFile structure initialized from file @filepath : filepath of the evtx file to parse return File : File structure initialized
func OpenDirty ¶ added in v1.2.4
OpenDirty is a wrapper around Open to handle the case where the file opened has its dirty flag set
func (*File) Chunks ¶
Chunks returns a chan of all the Chunks found in the current file return (chan Chunk)
func (*File) Events ¶
Events returns a chan pointers to all the GoEvtxMap found in the current file this is a slow implementation, FastEvents should be prefered return (chan *GoEvtxMap)
func (*File) FastEvents ¶
FastEvents returns a chan pointers to all the GoEvtxMap found in the current file. Same as Events method but the fast version return (chan *GoEvtxMap)
func (*File) FetchChunk ¶
FetchChunk fetches a Chunk @offset : offset in the current file where to find the Chunk return Chunk : Chunk parsed
func (*File) FetchRawChunk ¶
FetchRawChunk fetches a raw Chunk (without parsing String and Template tables) @offset : offset in the current file where to find the Chunk return Chunk : Chunk (raw) parsed
func (*File) MonitorEvents ¶
MonitorEvents returns a chan pointers to all the GoEvtxMap found in the File under monitoring. This is the fast version @stop: a channel used to stop the monitoring if needed return (chan *GoEvtxMap)
func (*File) ParseFileHeader ¶
func (ef *File) ParseFileHeader()
ParseFileHeader parses a the file header of the file structure and modifies the Header of the current structure
func (*File) SetMonitorExisting ¶
SetMonitorExisting sets monitorExisting flag of EvtxFile struct in order to return already existing events when using MonitorEvents
func (*File) UnorderedChunks ¶
UnorderedChunks returns a chan of all the Chunks found in the current file return (chan Chunk)
func (*File) UnorderedEvents ¶
UnorderedEvents returns a chan pointers to all the GoEvtxMap found in the current file. Same as FastEvents method but the order by time is not guaranteed. It can significantly improve preformances for big files. return (chan *GoEvtxMap)
type FileHeader ¶
type FileHeader struct { Magic [8]byte FirstChunkNum uint64 LastChunkNum uint64 NextRecordID uint64 HeaderSpace uint32 MinVersion uint16 MajVersion uint16 ChunkDataOffset uint16 ChunkCount uint16 Unknown [76]byte Flags uint32 CheckSum uint32 }
FileHeader structure definition
func (*FileHeader) Repair ¶ added in v1.2.4
func (f *FileHeader) Repair(r io.ReadSeeker) error
Repair the header. It makes sense to use this function whenever the file is flagged as dirty
func (FileHeader) String ¶
func (fh FileHeader) String() string
func (*FileHeader) Verify ¶ added in v1.2.4
func (f *FileHeader) Verify() error
type Fragment ¶
type Fragment struct { Offset int64 // For debug Header FragmentHeader BinXMLElement Element }
type FragmentHeader ¶
FragmentHeader : BinXMLFragmentHeader
func (*FragmentHeader) Parse ¶
func (fh *FragmentHeader) Parse(reader io.ReadSeeker) error
func (FragmentHeader) String ¶
func (fh FragmentHeader) String() string
type GoEvtxElement ¶
type GoEvtxElement interface{}
type GoEvtxMap ¶
type GoEvtxMap map[string]interface{}
func (*GoEvtxMap) Add ¶
Add : concatenate two GoEvtxMap together @other: other map to concatenate with
func (*GoEvtxMap) AnyEqual ¶
func (pg *GoEvtxMap) AnyEqual(path *GoEvtxPath, is []interface{}) bool
Equal returns true if element at path is equal to any object @path : path at witch GoEvtxElement is located @is : slice of interface to test equality with return bool : true if equality is verified
func (*GoEvtxMap) Channel ¶
Channel returns the Channel attribute of the event return string : Channel attribute
func (*GoEvtxMap) Del ¶
func (pg *GoEvtxMap) Del(path *GoEvtxPath)
Del deletes the object referenced by path
func (*GoEvtxMap) DelXmlns ¶
func (pg *GoEvtxMap) DelXmlns()
DelXmlns : utility function to delete useless xlmns entry found in every GoEvtxMap
func (*GoEvtxMap) Equal ¶
func (pg *GoEvtxMap) Equal(path *GoEvtxPath, i interface{}) bool
Equal returns true if element at path is equal to i @path : path at witch GoEvtxElement is located @i : interface to test equality with return bool : true if equality is verified
func (*GoEvtxMap) EventID ¶
EventID returns the EventID of the Event as a int64 return int64 : EventID
func (*GoEvtxMap) EventRecordID ¶
EventRecordID returns the EventRecordID of the the event. It panics if the attribute is not found in the event.
func (*GoEvtxMap) Get ¶
func (pg *GoEvtxMap) Get(path *GoEvtxPath) (*GoEvtxElement, error)
Recursive search in a GoEvtxMap according to a given path @path : path to search for return *GoEvtxElement, error : pointer to the element found at path
func (*GoEvtxMap) GetBool ¶
func (pg *GoEvtxMap) GetBool(path *GoEvtxPath) (bool, error)
GetBool returns the GoEvtxElement at path as a bool @path : path to search for return (bool, error)
func (*GoEvtxMap) GetBoolStrict ¶
func (pg *GoEvtxMap) GetBoolStrict(path *GoEvtxPath) bool
func (*GoEvtxMap) GetInt ¶
func (pg *GoEvtxMap) GetInt(path *GoEvtxPath) (int64, error)
GetInt returns the GoEvtxElement at path as a int64 @path : path to search for return int64, error
func (*GoEvtxMap) GetIntStrict ¶
func (pg *GoEvtxMap) GetIntStrict(path *GoEvtxPath) int64
func (*GoEvtxMap) GetMap ¶
func (pg *GoEvtxMap) GetMap(path *GoEvtxPath) (*GoEvtxMap, error)
GetMap : Get the full map containing the path @path : path to search for
func (*GoEvtxMap) GetMapStrict ¶
func (pg *GoEvtxMap) GetMapStrict(path *GoEvtxPath) *GoEvtxMap
func (*GoEvtxMap) GetMapWhere ¶
func (pg *GoEvtxMap) GetMapWhere(path *GoEvtxPath, value interface{}) (*GoEvtxMap, error)
func (*GoEvtxMap) GetMapWhereStrict ¶
func (pg *GoEvtxMap) GetMapWhereStrict(path *GoEvtxPath, value interface{}) *GoEvtxMap
func (*GoEvtxMap) GetStrict ¶
func (pg *GoEvtxMap) GetStrict(path *GoEvtxPath) *GoEvtxElement
func (*GoEvtxMap) GetString ¶
func (pg *GoEvtxMap) GetString(path *GoEvtxPath) (string, error)
GetUint returns the GoEvtxElement at path as a string @path : path to search for return string, error
func (*GoEvtxMap) GetStringStrict ¶
func (pg *GoEvtxMap) GetStringStrict(path *GoEvtxPath) string
func (*GoEvtxMap) GetTime ¶
func (pg *GoEvtxMap) GetTime(path *GoEvtxPath) (time.Time, error)
GetUint returns the GoEvtxElement at path as a Time struct @path : path to search for return Time
func (*GoEvtxMap) GetTimeStrict ¶
func (pg *GoEvtxMap) GetTimeStrict(path *GoEvtxPath) time.Time
func (*GoEvtxMap) GetUint ¶
func (pg *GoEvtxMap) GetUint(path *GoEvtxPath) (uint64, error)
GetUint returns the GoEvtxElement at path as a uint64 @path : path to search for return uint64
func (*GoEvtxMap) GetUintStrict ¶
func (pg *GoEvtxMap) GetUintStrict(path *GoEvtxPath) uint64
func (*GoEvtxMap) HasKeys ¶
HasKeys : determines whether this map is in a key value form return bool
func (*GoEvtxMap) IsEventID ¶
IsEventID returns true if pg is one of the EventID number specified in parameter @eids : EventID numbers to test against return bool
func (*GoEvtxMap) RegexMatch ¶
func (pg *GoEvtxMap) RegexMatch(path *GoEvtxPath, pattern *regexp.Regexp) bool
RegexMatch returns true if GoEvtxElement located at path matches a regexp @path : path at witch GoEvtxElement is located @pattern : regexp to test return bool
func (*GoEvtxMap) Set ¶
func (pg *GoEvtxMap) Set(path *GoEvtxPath, new GoEvtxElement) error
Set sets a new GoEvtxElement at path @path... : path to look for @new : new value return error if any
func (*GoEvtxMap) TimeCreated ¶
TimeCreated returns the creation time of the event. It panics if the attribute is not in the event
type GoEvtxPath ¶
type GoEvtxPath []string
func Path ¶
func Path(s string) GoEvtxPath
Path : helper function that converts a path string to a table of strings @s : path string, has to be in form of /correct/path/string with (correct, path, string) being keys to look for recursively
func (GoEvtxPath) String ¶
func (p GoEvtxPath) String() string
type Name ¶
type Name struct { OffsetPrevString int32 Hash uint16 Size uint16 UTF16String UTF16String }
Name : same as ChunkString
type Node ¶
type Node struct { Start *ElementStart Element []Element Child []*Node }
type NormalSubstitution ¶
NormalSubstitution : BinXmlNormalSubstitution
func (*NormalSubstitution) IsAttributeData ¶
func (n *NormalSubstitution) IsAttributeData() bool
func (*NormalSubstitution) Parse ¶
func (n *NormalSubstitution) Parse(reader io.ReadSeeker) error
func (*NormalSubstitution) String ¶
func (n *NormalSubstitution) String() string
type OptionalSubstitution ¶
type OptionalSubstitution struct {
NormalSubstitution
}
type Substitution ¶
type Substitution interface { }
type SysTime ¶
type TemplateDefinition ¶
type TemplateDefinition struct { Header TemplateDefinitionHeader Data TemplateDefinitionData }
func (*TemplateDefinition) Parse ¶
func (td *TemplateDefinition) Parse(reader io.ReadSeeker) error
func (TemplateDefinition) String ¶
func (td TemplateDefinition) String() string
type TemplateDefinitionData ¶
type TemplateDefinitionData struct { Unknown3 int32 ID [16]byte Size int32 FragHeader FragmentHeader Elements []Element EOFToken int8 }
func (*TemplateDefinitionData) Parse ¶
func (td *TemplateDefinitionData) Parse(reader io.ReadSeeker) error
type TemplateDefinitionHeader ¶
func (*TemplateDefinitionHeader) Parse ¶
func (tdh *TemplateDefinitionHeader) Parse(reader io.ReadSeeker) error
type TemplateInstance ¶
type TemplateInstance struct { Token int8 Definition TemplateDefinition Data TemplateInstanceData }
TemplateInstance : BinXmlTemplateInstance
func (*TemplateInstance) DataOffset ¶
func (ti *TemplateInstance) DataOffset(reader io.ReadSeeker) (offset int32, err error)
func (*TemplateInstance) ElementToGoEvtx ¶
func (ti *TemplateInstance) ElementToGoEvtx(elt Element) GoEvtxElement
func (*TemplateInstance) GoEvtxMap ¶
func (ti *TemplateInstance) GoEvtxMap() *GoEvtxMap
func (*TemplateInstance) NodeToGoEvtx ¶
func (ti *TemplateInstance) NodeToGoEvtx(n *Node) GoEvtxMap
func (*TemplateInstance) Parse ¶
func (ti *TemplateInstance) Parse(reader io.ReadSeeker) error
func (*TemplateInstance) ParseTemplateDefinitionHeader ¶
func (ti *TemplateInstance) ParseTemplateDefinitionHeader(reader io.ReadSeeker) error
func (*TemplateInstance) Root ¶
func (ti *TemplateInstance) Root() Node
func (TemplateInstance) String ¶
func (ti TemplateInstance) String() string
type TemplateInstanceData ¶
type TemplateInstanceData struct { NumValues int32 ValDescs []ValueDescriptor Values []Element ValueOffsets []int32 }
TemplateInstanceData structure
func (*TemplateInstanceData) Parse ¶
func (tid *TemplateInstanceData) Parse(reader io.ReadSeeker) error
Parse Element implementation
type UTCTime ¶
UTCTime structure definition
func (UTCTime) MarshalJSON ¶
MarshalJSON implements JSON serialization
type UTF16 ¶
type UTF16 uint16
////////////////////////////// UTF16String /////////////////////////////////// NB: We keep those structure for compatibility with parts of the code
type UTF16String ¶
type UTF16String []uint16
func (*UTF16String) Len ¶
func (us *UTF16String) Len() int32
func (UTF16String) ToString ¶
func (us UTF16String) ToString() string
type UnicodeTextString ¶
type UnicodeTextString struct { Size int16 // Number of characters, has to be x2 String UTF16String // UTF-16 little-endian string without an end-of-string character }
func (*UnicodeTextString) GetSize ¶
func (uts *UnicodeTextString) GetSize() int32
func (*UnicodeTextString) Parse ¶
func (uts *UnicodeTextString) Parse(reader io.ReadSeeker) error
type UnkVal ¶
type UnkVal struct { Offset int64 Token ValueType Desc ValueDescriptor }
type Value ¶
type Value interface { // Repr is the way it is represented in GoEvtx Repr() interface{} Value() interface{} String() string }
type ValueArrayUInt16 ¶
type ValueArrayUInt16 struct { Size uint16 // contains filtered or unexported fields }
func (*ValueArrayUInt16) Parse ¶
func (a *ValueArrayUInt16) Parse(reader io.ReadSeeker) error
func (*ValueArrayUInt16) Repr ¶
func (a *ValueArrayUInt16) Repr() interface{}
func (*ValueArrayUInt16) String ¶
func (a *ValueArrayUInt16) String() string
func (*ValueArrayUInt16) Value ¶
func (a *ValueArrayUInt16) Value() interface{}
type ValueArrayUInt64 ¶
type ValueArrayUInt64 struct { Size uint16 // contains filtered or unexported fields }
func (*ValueArrayUInt64) Parse ¶
func (a *ValueArrayUInt64) Parse(reader io.ReadSeeker) error
func (*ValueArrayUInt64) Repr ¶
func (a *ValueArrayUInt64) Repr() interface{}
func (*ValueArrayUInt64) String ¶
func (a *ValueArrayUInt64) String() string
func (*ValueArrayUInt64) Value ¶
func (a *ValueArrayUInt64) Value() interface{}
type ValueBinary ¶
type ValueBinary struct { Size uint16 // contains filtered or unexported fields }
func (*ValueBinary) Parse ¶
func (b *ValueBinary) Parse(reader io.ReadSeeker) error
func (*ValueBinary) Repr ¶
func (b *ValueBinary) Repr() interface{}
func (*ValueBinary) String ¶
func (b *ValueBinary) String() string
func (*ValueBinary) Value ¶
func (b *ValueBinary) Value() interface{}
type ValueBool ¶
type ValueBool struct {
ValueInt32
}
type ValueDescriptor ¶
func (ValueDescriptor) String ¶
func (v ValueDescriptor) String() string
type ValueFileTime ¶
type ValueFileTime struct {
// contains filtered or unexported fields
}
func (*ValueFileTime) Parse ¶
func (s *ValueFileTime) Parse(reader io.ReadSeeker) error
func (*ValueFileTime) Repr ¶
func (s *ValueFileTime) Repr() interface{}
func (*ValueFileTime) String ¶
func (s *ValueFileTime) String() string
func (*ValueFileTime) Value ¶
func (s *ValueFileTime) Value() interface{}
type ValueHexInt32 ¶
type ValueHexInt32 struct {
ValueUInt32
}
func (*ValueHexInt32) Repr ¶
func (i *ValueHexInt32) Repr() interface{}
func (*ValueHexInt32) String ¶
func (i *ValueHexInt32) String() string
func (*ValueHexInt32) Value ¶
func (i *ValueHexInt32) Value() interface{}
type ValueHexInt64 ¶
type ValueHexInt64 struct {
ValueUInt64
}
Just for display so that we have not the unsigned format of fmt
func (*ValueHexInt64) Repr ¶
func (i *ValueHexInt64) Repr() interface{}
func (*ValueHexInt64) String ¶
func (i *ValueHexInt64) String() string
func (*ValueHexInt64) Value ¶
func (i *ValueHexInt64) Value() interface{}
type ValueInt16 ¶
type ValueInt16 struct {
// contains filtered or unexported fields
}
func (*ValueInt16) Parse ¶
func (i *ValueInt16) Parse(reader io.ReadSeeker) error
func (*ValueInt16) Repr ¶
func (i *ValueInt16) Repr() interface{}
func (*ValueInt16) String ¶
func (i *ValueInt16) String() string
func (*ValueInt16) Value ¶
func (i *ValueInt16) Value() interface{}
type ValueInt32 ¶
type ValueInt32 struct {
// contains filtered or unexported fields
}
func (*ValueInt32) Parse ¶
func (i *ValueInt32) Parse(reader io.ReadSeeker) error
func (*ValueInt32) Repr ¶
func (i *ValueInt32) Repr() interface{}
func (*ValueInt32) String ¶
func (i *ValueInt32) String() string
func (*ValueInt32) Value ¶
func (i *ValueInt32) Value() interface{}
type ValueInt64 ¶
type ValueInt64 struct {
// contains filtered or unexported fields
}
func (*ValueInt64) Parse ¶
func (i *ValueInt64) Parse(reader io.ReadSeeker) error
func (*ValueInt64) Repr ¶
func (i *ValueInt64) Repr() interface{}
func (*ValueInt64) String ¶
func (i *ValueInt64) String() string
func (*ValueInt64) Value ¶
func (i *ValueInt64) Value() interface{}
type ValueReal32 ¶
type ValueReal32 struct {
// contains filtered or unexported fields
}
func (*ValueReal32) Parse ¶
func (v *ValueReal32) Parse(reader io.ReadSeeker) error
func (*ValueReal32) Repr ¶
func (v *ValueReal32) Repr() interface{}
func (*ValueReal32) String ¶
func (v *ValueReal32) String() string
func (*ValueReal32) Value ¶
func (v *ValueReal32) Value() interface{}
type ValueReal64 ¶
type ValueReal64 struct {
// contains filtered or unexported fields
}
func (*ValueReal64) Parse ¶
func (v *ValueReal64) Parse(reader io.ReadSeeker) error
func (*ValueReal64) Repr ¶
func (v *ValueReal64) Repr() interface{}
func (*ValueReal64) String ¶
func (v *ValueReal64) String() string
func (*ValueReal64) Value ¶
func (v *ValueReal64) Value() interface{}
type ValueString ¶
type ValueString struct { Size uint16 // contains filtered or unexported fields }
func (*ValueString) Parse ¶
func (s *ValueString) Parse(reader io.ReadSeeker) error
func (*ValueString) Repr ¶
func (s *ValueString) Repr() interface{}
func (*ValueString) String ¶
func (s *ValueString) String() string
func (*ValueString) Value ¶
func (s *ValueString) Value() interface{}
type ValueStringTable ¶
type ValueStringTable struct { Size uint16 // contains filtered or unexported fields }
func (*ValueStringTable) Bytes ¶
func (st *ValueStringTable) Bytes() []byte
func (*ValueStringTable) Parse ¶
func (st *ValueStringTable) Parse(reader io.ReadSeeker) error
func (*ValueStringTable) Repr ¶
func (st *ValueStringTable) Repr() interface{}
func (*ValueStringTable) String ¶
func (st *ValueStringTable) String() string
func (*ValueStringTable) Value ¶
func (st *ValueStringTable) Value() interface{}
type ValueSysTime ¶
type ValueSysTime struct {
// contains filtered or unexported fields
}
func (*ValueSysTime) Parse ¶
func (s *ValueSysTime) Parse(reader io.ReadSeeker) error
func (*ValueSysTime) Repr ¶
func (s *ValueSysTime) Repr() interface{}
func (*ValueSysTime) String ¶
func (s *ValueSysTime) String() string
func (*ValueSysTime) Time ¶
func (s *ValueSysTime) Time() UTCTime
func (*ValueSysTime) Value ¶
func (s *ValueSysTime) Value() interface{}
type ValueText ¶
type ValueText struct { Token int8 ValType int8 Value UnicodeTextString // UnicodeTextString }
func (*ValueText) IsAttributeData ¶
type ValueUInt16 ¶
type ValueUInt16 struct {
// contains filtered or unexported fields
}
func (*ValueUInt16) Parse ¶
func (u *ValueUInt16) Parse(reader io.ReadSeeker) error
func (*ValueUInt16) Repr ¶
func (u *ValueUInt16) Repr() interface{}
func (*ValueUInt16) String ¶
func (u *ValueUInt16) String() string
func (*ValueUInt16) Value ¶
func (u *ValueUInt16) Value() interface{}
type ValueUInt32 ¶
type ValueUInt32 struct {
// contains filtered or unexported fields
}
func (*ValueUInt32) Parse ¶
func (u *ValueUInt32) Parse(reader io.ReadSeeker) error
func (*ValueUInt32) Repr ¶
func (u *ValueUInt32) Repr() interface{}
func (*ValueUInt32) String ¶
func (u *ValueUInt32) String() string
func (*ValueUInt32) Value ¶
func (u *ValueUInt32) Value() interface{}
type ValueUInt64 ¶
type ValueUInt64 struct {
// contains filtered or unexported fields
}
func (*ValueUInt64) Parse ¶
func (u *ValueUInt64) Parse(reader io.ReadSeeker) error
func (*ValueUInt64) Repr ¶
func (u *ValueUInt64) Repr() interface{}
func (*ValueUInt64) String ¶
func (u *ValueUInt64) String() string
func (*ValueUInt64) Value ¶
func (u *ValueUInt64) Value() interface{}
type ValueUInt8 ¶
type ValueUInt8 struct {
// contains filtered or unexported fields
}
func (*ValueUInt8) Parse ¶
func (u *ValueUInt8) Parse(reader io.ReadSeeker) error
func (*ValueUInt8) Repr ¶
func (u *ValueUInt8) Repr() interface{}
func (*ValueUInt8) String ¶
func (u *ValueUInt8) String() string
func (*ValueUInt8) Value ¶
func (u *ValueUInt8) Value() interface{}