Documentation
¶
Index ¶
- type ISQL
- type MySQL
- func (pg *MySQL) Close()
- func (mysql *MySQL) GetAllKernelVuln() (kvs []common.Vulnerablity)
- func (mysql *MySQL) GetProgramVulnerabilities(exfile *common.ExtractedFile) (vlunerabilities []common.Vulnerablity, err error)
- func (mysql *MySQL) IsKnownFileByName(exfile *common.ExtractedFile) bool
- func (mysql *MySQL) IsKnownFileByType(exfile *common.ExtractedFile) bool
- func (mysql *MySQL) Open(h, u, p, d string) bool
- func (mysql *MySQL) SearchProgramVulnerabilityTable(exfile common.ExtractedFile) (vlunerabilities []common.Vulnerablity)
- type PostgresSQL
- func (pg *PostgresSQL) Close()
- func (pg *PostgresSQL) GetAllKernelVuln() (kvs []common.Vulnerablity)
- func (pg *PostgresSQL) GetProgramVulnerabilities(exfile *common.ExtractedFile) (vlunerabilities []common.Vulnerablity, err error)
- func (pg *PostgresSQL) IsKnownFileByName(exfile *common.ExtractedFile) bool
- func (pg *PostgresSQL) IsKnownFileByType(exfile *common.ExtractedFile) bool
- func (pg *PostgresSQL) Open(h, u, p, d string) bool
- func (pg *PostgresSQL) SearchProgramVulnerabilityTable(exfile common.ExtractedFile) (vlunerabilities []common.Vulnerablity)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISQL ¶
type ISQL interface {
// 打开数据库连接
// !在调用完数据库后一定要使用Close关闭连接。
// @param h host
// @param u user
// @param p password
// @param d database name
// @return *sql.DB db指针
// @return error 错误
Open(h, u, p, d string) bool
// 关闭数据库连接
// !在调用完数据库后一定要关闭连接。
Close()
// 通过查询已知文件表(known file table)来判断文件是否已知
// 如果是已知文件,则会填充对应的数据
IsKnownFileByName(exfile *common.ExtractedFile) bool
// 通过查询文件类型表(file type table)来判断文件是否已知
// 如果是已知文件,则会填充对应的数据
IsKnownFileByType(exfile *common.ExtractedFile) bool
// 获取内核表中所有的数据
// todo 根据内核版本返回符合版本的漏洞信息
GetAllKernelVuln() []common.Vulnerablity
// 获取该文件的漏洞列表
GetProgramVulnerabilities(*common.ExtractedFile) (
[]common.Vulnerablity, error)
// 搜索符合条件的程序漏洞
SearchProgramVulnerabilityTable(common.ExtractedFile) []common.Vulnerablity
}
var Isql ISQL
sql操作对象
type MySQL ¶
func (*MySQL) GetAllKernelVuln ¶
func (mysql *MySQL) GetAllKernelVuln() (kvs []common.Vulnerablity)
从内核CVE表中查询
@return 所有关于内核CVE的记录
func (*MySQL) GetProgramVulnerabilities ¶
func (mysql *MySQL) GetProgramVulnerabilities( exfile *common.ExtractedFile) ( vlunerabilities []common.Vulnerablity, err error)
判断是否存在漏洞
func (*MySQL) IsKnownFileByName ¶
func (mysql *MySQL) IsKnownFileByName(exfile *common.ExtractedFile) bool
从known_file表中查询
@param 关键字:文件名 @return known_file_struct文件信息结构体的数组
func (*MySQL) IsKnownFileByType ¶
func (mysql *MySQL) IsKnownFileByType(exfile *common.ExtractedFile) bool
从file_type表中查询
@param 文件结构体 @return 是否查询到对应的记录
func (*MySQL) SearchProgramVulnerabilityTable ¶
func (mysql *MySQL) SearchProgramVulnerabilityTable( exfile common.ExtractedFile) (vlunerabilities []common.Vulnerablity)
type PostgresSQL ¶
func (*PostgresSQL) GetAllKernelVuln ¶
func (pg *PostgresSQL) GetAllKernelVuln() (kvs []common.Vulnerablity)
从内核CVE表中查询
@return 所有关于内核CVE的记录
func (*PostgresSQL) GetProgramVulnerabilities ¶
func (pg *PostgresSQL) GetProgramVulnerabilities( exfile *common.ExtractedFile) ( vlunerabilities []common.Vulnerablity, err error)
判断是否存在漏洞
func (*PostgresSQL) IsKnownFileByName ¶
func (pg *PostgresSQL) IsKnownFileByName(exfile *common.ExtractedFile) bool
从known_file表中查询
@param 关键字:文件名 @return known_file_struct文件信息结构体的数组
func (*PostgresSQL) IsKnownFileByType ¶
func (pg *PostgresSQL) IsKnownFileByType(exfile *common.ExtractedFile) bool
从file_type表中查询
@param 文件结构体 @return 是否查询到对应的记录
func (*PostgresSQL) Open ¶
func (pg *PostgresSQL) Open(h, u, p, d string) bool
OpenPostgresDB 打开Postgres数据库
@return bool true:正常打开数据库,false:打开数据库失败
!在调用完数据库后一定要使用ClosePostgresDB关闭连接。
func (*PostgresSQL) SearchProgramVulnerabilityTable ¶
func (pg *PostgresSQL) SearchProgramVulnerabilityTable( exfile common.ExtractedFile) (vlunerabilities []common.Vulnerablity)
Click to show internal directories.
Click to hide internal directories.