common

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsContainString

func IsContainString(str string, array []string) bool

IsContainString 判断str是否在array字符串数组中

@param str
@param array
@return bool

Types

type BinFileInfo

type BinFileInfo struct {
	Name string
	Dir  string
	MD5  string
}

func (BinFileInfo) GetMD5

func (f BinFileInfo) GetMD5() string

type ExtractedFile

type ExtractedFile struct {
	///////////////////  这部分对应known file table表///////////////////
	// 文件名
	Name string
	// 文件所在的目录
	Dir string
	// flag
	Flag uint32
	// 该文件的重要性。如果重要性为0,在分析的时候直接忽略。
	Rating int
	// 这个文件出现的次数
	Count int
	// 文件的描述信息。
	Description string

	// 搜索版本信息时的关键字
	VersionSearchKey string
	// 过滤出版本信息的正则表达式
	VersionSearchRegular string
	// 版本信息
	Version Version
	// 该文件的md5值。
	Md5 string
}

文件的结构体,描述文件的信息

func (*ExtractedFile) GetBinaryVersion

func (exfile *ExtractedFile) GetBinaryVersion() error

Get the version information of the binary program file.

type Report

type Report struct {
	Binfile               BinFileInfo
	KernelVersion         string
	KernelInfo            string
	Kernelvulnerablities  []Vulnerablity
	Programvulnerablities []Vulnerablity
}

最终报告结构体

func (Report) ToJson

func (r Report) ToJson() string

type Version

type Version struct {
	// 主版本号
	MajorVersion int
	// 次版本号
	MinorVersion int
	// 修订版本号
	PatchVersion int
}

func (*Version) IsAfter

func (v *Version) IsAfter(another Version) int

IsAfter 判断当前版本号是否比另一个(参数)版本号大。 @receiver l 本身版本对象 @param another 另一个比较对象 @return int 返回比较结果。0: 版本一致。1: 比另一个版本大。-1: 比另一个版本小。

func (*Version) ToString

func (v *Version) ToString() string

转成字符串

type Vulnerablity

type Vulnerablity struct {
	// 漏洞编号,一般为CVE或者CNVD等
	ID string
	// 影响的内核的版本号
	AffectedVersion string
	// 漏洞类型
	Type string
	// 漏洞描述
	Description string
	// 漏洞严重程度,1-10评分,1不严重,10最严重
	Severity int
	// 修复建议
	FixSuggestion string
	// 攻击层。
	// kernel
	// shell
	// file system
	// user applicaion
	LayerOfAttack string
	// 攻击目标
	TargetOfAttack string
}

func (*Vulnerablity) IsAffected

func (v *Vulnerablity) IsAffected(ver Version) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL