Documentation ¶
Index ¶
- Constants
- Variables
- type File
- type FileReader
- func (rdr *FileReader) Close() error
- func (rdr *FileReader) OpenFileScans() (io.ReadCloser, error)
- func (rdr *FileReader) OpenMemoryScans() (io.ReadCloser, error)
- func (rdr *FileReader) OpenMeta() (io.ReadCloser, error)
- func (rdr *FileReader) OpenProcesses() (io.ReadCloser, error)
- func (rdr *FileReader) OpenStatistics() (io.ReadCloser, error)
- func (rdr *FileReader) OpenSystemInformation() (io.ReadCloser, error)
- func (rdr *FileReader) SetKeyring(keyring openpgp.EntityList)
- func (rdr *FileReader) SetPassword(password string)
- type FileScan
- type Match
- type MatchString
- type MemoryScan
- type MemorySegmentInfo
- type MetaInformation
- type Parser
- type ProcessInfo
- type ProfilingInformation
- type ProfilingInformationV100
- type Reader
- type ReaderFactory
- type Report
- type ReportWriter
- type ScanningStatistics
- type ScanningStatisticsV100
- type SystemInfo
- type Time
- type TimeV100
- type Validator
Constants ¶
const FileScansFileName = "file-scans.json"
FileScansFileName is the name of the file used to report information about file scans.
const MemoryScansFileName = "memory-scans.json"
MemoryScansFileName is the name of the file used to report information about memory scans.
const MetaFileName = "meta.json"
MetaFileName is the name of the file containing meta information about the report format.
const ProcessesFileName = "processes.json"
ProcessesFileName is the name of the file used to report information about processes.
const RulesFileName = "rules.yarc"
RulesFileName is the name of the file, where the used rules will be stored.
const ScanningStatisticsFileName = "stats.json"
ScanningStatisticsFileName is the name of the file used to report scanning.
const SystemInfoFileName = "systeminfo.json"
SystemInfoFileName is the name of the file, where system info is stored.
const TimeFormat = "2006-01-02T15:04:05.000000-07:00"
const TimeFormatV100 = "2006-01-02T15:04:05.000000Z-07:00"
Variables ¶
var FormatVersion = version.Version{
Major: 1,
Minor: 1,
Bugfix: 0,
}
var MetaV1Schema = fmt.Sprintf(schemaURLFormat, "1.0.0", "meta.schema.json")
Functions ¶
This section is empty.
Types ¶
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
func (*FileReader) Close ¶
func (rdr *FileReader) Close() error
func (*FileReader) OpenFileScans ¶
func (rdr *FileReader) OpenFileScans() (io.ReadCloser, error)
func (*FileReader) OpenMemoryScans ¶
func (rdr *FileReader) OpenMemoryScans() (io.ReadCloser, error)
func (*FileReader) OpenMeta ¶
func (rdr *FileReader) OpenMeta() (io.ReadCloser, error)
func (*FileReader) OpenProcesses ¶
func (rdr *FileReader) OpenProcesses() (io.ReadCloser, error)
func (*FileReader) OpenStatistics ¶
func (rdr *FileReader) OpenStatistics() (io.ReadCloser, error)
func (*FileReader) OpenSystemInformation ¶
func (rdr *FileReader) OpenSystemInformation() (io.ReadCloser, error)
func (*FileReader) SetKeyring ¶
func (rdr *FileReader) SetKeyring(keyring openpgp.EntityList)
func (*FileReader) SetPassword ¶
func (rdr *FileReader) SetPassword(password string)
type FileScan ¶
type FileScan struct { File *File `json:"file"` Matches []*Match `json:"match"` Error interface{} `json:"error"` }
FileScan represents all matches on a file.
type Match ¶
type Match struct { Rule string `json:"rule"` Namespace string `json:"namespace"` Strings []*MatchString `json:"strings"` }
Match represents the match of a yara Rule.
type MatchString ¶
type MatchString struct { Name string `json:"name"` Base uint64 `json:"base"` Offset uint64 `json:"offset"` }
A MatchString represents a string declared and matched in a rule.
type MemoryScan ¶
type MemoryScan struct { PID int `json:"pid"` MemorySegment uintptr `json:"memorySegment"` Matches []*Match `json:"match"` Error interface{} `json:"error"` }
MemoryScan represents all matches on a single memory segment of a process.
type MemorySegmentInfo ¶
type MemorySegmentInfo struct { // ParentBaseAddress is the base address of the parent segment. // If no parent segment exists, this is equal to the BaseAddress. // Equivalence on windows: _MEMORY_BASIC_INFORMATION->AllocationBase ParentBaseAddress uintptr `json:"parentBaseAddress"` // BaseAddress is the base address of the current memory segment. // Equivalence on windows: _MEMORY_BASIC_INFORMATION->BaseAddress BaseAddress uintptr `json:"baseAddress"` // AllocatedPermissions is the Permissions that were used to initially // allocate this segment. // Equivalence on windows: _MEMORY_BASIC_INFORMATION->AllocationProtect AllocatedPermissions procio.Permissions `json:"allocatedPermissions"` // CurrentPermissions is the Permissions that the segment currently has. // This may differ from AllocatedPermissions if the permissions where changed // at some point (e.g. via VirtualProtect). // Equivalence on windows: _MEMORY_BASIC_INFORMATION->Protect CurrentPermissions procio.Permissions `json:"currentPermissions"` // Size contains the size of the segment in bytes. // Equivalence on windows: _MEMORY_BASIC_INFORMATION->RegionSize Size uintptr `json:"size"` // RSS contains the ResidentSetSize as reported on linux, i.e. // the amount of RAM this segment actually uses right now. // Equivalence on windows: No equivalence, this is currently always equal to Size. RSS uintptr `json:"rss"` // State contains the current State of the segment. // Equivalence on windows: _MEMORY_BASIC_INFORMATION->State State procio.State `json:"state"` // Type contains the Type of the segment. // Equivalence on windows: _MEMORY_BASIC_INFORMATION->SegmentType Type procio.SegmentType `json:"type"` // File contains the path to the mapped file, or empty string if // no file mapping is associated with this memory segment. MappedFile *File `json:"mappedFile"` }
MemorySegmentInfo contains information about a memory segment.
type MetaInformation ¶
type MetaInformation struct { YapscanVersion version.Version `json:"yapscanVersion"` FormatVersion version.Version `json:"formatVersion"` SchemaURLs map[string]string `json:"schemaURLs"` }
func GetMetaInformation ¶
func GetMetaInformation() *MetaInformation
type ProcessInfo ¶
type ProcessInfo struct { PID int `json:"pid"` Bitness arch.Bitness `json:"bitness"` ExecutablePath string `json:"executablePath"` ExecutableMD5 string `json:"executableMD5"` ExecutableSHA256 string `json:"executableSHA256"` Username string `json:"username"` MemorySegments []*MemorySegmentInfo `json:"memorySegments"` }
ProcessInfo represents information about a Process.
type ProfilingInformation ¶
type ProfilingInformationV100 ¶ added in v0.15.0
type ProfilingInformationV100 struct { Time TimeV100 `json:"time"` FreeRAM uintptr `json:"freeRAM"` FreeSwap uintptr `json:"freeSwap"` LoadAvgOneMinute float64 `json:"loadAvgOneMinute"` LoadAvgFiveMinutes float64 `json:"loadAvgFiveMinutes"` LoadAvgFifteenMinutes float64 `json:"loadAvgFifteenMinutes"` }
type Reader ¶
type Reader interface { SetPassword(password string) SetKeyring(keyring openpgp.EntityList) OpenMeta() (io.ReadCloser, error) OpenSystemInformation() (io.ReadCloser, error) OpenStatistics() (io.ReadCloser, error) OpenProcesses() (io.ReadCloser, error) OpenMemoryScans() (io.ReadCloser, error) OpenFileScans() (io.ReadCloser, error) io.Closer }
func NewFileReader ¶
type ReaderFactory ¶ added in v0.15.0
type ReaderFactory struct {
// contains filtered or unexported fields
}
func NewReaderFactory ¶ added in v0.15.0
func NewReaderFactory() *ReaderFactory
func (*ReaderFactory) OpenFile ¶ added in v0.15.0
func (f *ReaderFactory) OpenFile(path string) Reader
func (*ReaderFactory) SetKeyring ¶ added in v0.15.0
func (f *ReaderFactory) SetKeyring(keyring openpgp.EntityList)
func (*ReaderFactory) SetPassword ¶ added in v0.15.0
func (f *ReaderFactory) SetPassword(password string)
type Report ¶
type Report struct { Meta *MetaInformation Stats *ScanningStatistics SystemInfo *SystemInfo Processes []*ProcessInfo MemoryScans []*MemoryScan FileScans []*FileScan }
type ReportWriter ¶ added in v0.15.0
type ReportWriter struct {
// contains filtered or unexported fields
}
func NewReportWriter ¶ added in v0.15.0
func NewReportWriter(archiver archiver.Archiver) *ReportWriter
func (*ReportWriter) WriteReport ¶ added in v0.15.0
func (w *ReportWriter) WriteReport(rprt *Report) (err error)
type ScanningStatistics ¶
type ScanningStatistics struct { Start Time `json:"start"` End Time `json:"end"` NumberOfProcessesScanned uint64 `json:"numberOfProcessesScanned"` NumberOfSegmentsScanned uint64 `json:"numberOfSegmentsScanned"` NumberOfMemoryBytesScanned uint64 `json:"numberOfMemoryBytesScanned"` NumberOfFileBytesScanned uint64 `json:"numberOfFileBytesScanned"` NumberOfFilesScanned uint64 `json:"numberOfFilesScanned"` ProfilingInformation []*ProfilingInformation `json:"profilingInformation"` }
ScanningStatistics holds statistic information about a scan.
type ScanningStatisticsV100 ¶ added in v0.15.0
type ScanningStatisticsV100 struct { Start TimeV100 `json:"start"` End TimeV100 `json:"end"` NumberOfProcessesScanned uint64 `json:"numberOfProcessesScanned"` NumberOfSegmentsScanned uint64 `json:"numberOfSegmentsScanned"` NumberOfMemoryBytesScanned uint64 `json:"numberOfMemoryBytesScanned"` NumberOfFileBytesScanned uint64 `json:"numberOfFileBytesScanned"` NumberOfFilesScanned uint64 `json:"numberOfFilesScanned"` ProfilingInformation []*ProfilingInformationV100 `json:"profilingInformation"` }
ScanningStatisticsV100 holds statistic information about a scan.
type SystemInfo ¶
type SystemInfo struct { OSName string `json:"osName"` OSVersion string `json:"osVersion"` OSFlavour string `json:"osFlavour"` OSArch arch.T `json:"osArch"` Hostname string `json:"hostname"` IPs []string `json:"ips"` NumCPUs int `json:"numCPUs"` TotalRAM uintptr `json:"totalRAM"` TotalSwap uintptr `json:"totalSwap"` }
SystemInfo contains information about the running system.
type TimeV100 ¶ added in v0.15.0
func (*TimeV100) UnmarshalJSON ¶ added in v0.15.0
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}