models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const LatestSchemaVersion = 2

LatestSchemaVersion manages the Schema version used in the latest go-exploitdb.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	ID                  int64                 `json:"-"`
	OffensiveSecurityID int64                 `json:"-"`
	ExploitUniqueID     string                `gorm:"type:varchar(255)" csv:"id" json:"-"`
	DocumentURL         string                `gorm:"type:varchar(255)" csv:"file" json:"document_url"`
	Description         string                `gorm:"type:text" csv:"description" json:"description"`
	Date                OffensiveSecurityTime `gorm:"type:time" csv:"date" json:"date"`
	Author              string                `gorm:"type:varchar(255)" csv:"author" json:"author"`
	// docs local remote webapps
	Type     string `gorm:"type:varchar(255)" csv:"type" json:"type"`
	Platform string `gorm:"type:varchar(255)" csv:"platform" json:"palatform"`
	Port     string `gorm:"type:varchar(255)" csv:"port" json:"port"`
}

Document : https://github.com/offensive-security/exploitdb/tree/master/exploits

type Exploit

type Exploit struct {
	ID                int64              `json:"-"`
	ExploitType       ExploitType        `gorm:"type:varchar(255)" json:"exploit_type"`
	ExploitUniqueID   string             `gorm:"type:varchar(255);index:idx_exploit_exploit_unique_id" json:"exploit_unique_id"`
	URL               string             `gorm:"type:varchar(255)" json:"url"`
	Description       string             `gorm:"type:text" json:"description"`
	CveID             string             `gorm:"type:varchar(255);index:idx_exploit_cve_id" json:"cve_id"`
	OffensiveSecurity *OffensiveSecurity `json:"offensive_security"`
	GitHubRepository  *GitHubRepository  `json:"github_repository"`
}

Exploit :

type ExploitType

type ExploitType string

ExploitType :

var (
	// OffensiveSecurityType : https://www.exploit-db.com/
	OffensiveSecurityType ExploitType = "OffensiveSecurity"
	// GitHubRepositoryType :
	GitHubRepositoryType ExploitType = "GitHub"
	// AwesomePocType :
	AwesomePocType ExploitType = "AwesomePoc"
)

type FetchMeta added in v0.2.0

type FetchMeta struct {
	gorm.Model      `json:"-"`
	ExploitRevision string
	SchemaVersion   uint
}

FetchMeta has meta information about fetched exploit

func (FetchMeta) OutDated added in v0.2.0

func (f FetchMeta) OutDated() bool

OutDated checks whether last fetched feed is out dated

type GitHubRepoJSON

type GitHubRepoJSON struct {
	Name        string    `json:"name"`
	FullName    string    `json:"full_name"`
	Description string    `json:"description"`
	URL         string    `json:"html_url"`
	Star        int       `json:"stargazers_count"`
	Fork        int       `json:"forks_count"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

GitHubRepoJSON :

type GitHubRepository

type GitHubRepository struct {
	ID              int64     `json:"-"`
	ExploitID       int64     `json:"-"`
	ExploitUniqueID string    `gorm:"type:varchar(255)" json:"-"`
	Star            int       `json:"star"`
	Fork            int       `json:"fork"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

GitHubRepository :

type MitreXML

type MitreXML struct {
	Vulnerability []struct {
		CVE        string `xml:"CVE"`
		References []struct {
			// External, Self
			AttrType    string `xml:"Type,attr"`
			URL         string `xml:"URL"`
			Description string `xml:"Description"`
		} `xml:"References>Reference"`
	} `xml:"Vulnerability"`
}

MitreXML : http://cve.mitre.org/cve/cvrf.html

type OffensiveSecurity

type OffensiveSecurity struct {
	ID              int64      `json:"-"`
	ExploitID       int64      `json:"-"`
	ExploitUniqueID string     `gorm:"type:varchar(255)" json:"-"`
	Document        *Document  `json:"document"`
	ShellCode       *ShellCode `json:"shell_code"`
	Paper           *Paper     `json:"paper"`
}

OffensiveSecurity : https://www.exploit-db.com/

type OffensiveSecurityTime

type OffensiveSecurityTime struct {
	time.Time
}

OffensiveSecurityTime :

func (*OffensiveSecurityTime) Scan added in v0.2.0

func (date *OffensiveSecurityTime) Scan(value interface{}) error

Scan :

func (*OffensiveSecurityTime) UnmarshalCSV

func (date *OffensiveSecurityTime) UnmarshalCSV(csv string) (err error)

UnmarshalCSV : Convert the CSV string as internal date

func (OffensiveSecurityTime) Value added in v0.2.0

func (date OffensiveSecurityTime) Value() (driver.Value, error)

Value :

type Paper added in v0.2.0

type Paper struct {
	ID                  int64                 `json:"-"`
	OffensiveSecurityID int64                 `json:"-"`
	ExploitUniqueID     string                `gorm:"type:varchar(255)" csv:"id" json:"-"`
	PaperURL            string                `gorm:"type:varchar(255)" csv:"file" json:"paper_path"`
	Description         string                `gorm:"type:text" csv:"description" json:"description"`
	Date                OffensiveSecurityTime `csv:"date" json:"date"`
	Author              string                `gorm:"type:varchar(255)" csv:"author" json:"author"`
	Type                string                `gorm:"type:varchar(255)" csv:"type" json:"type"`
	Platform            string                `gorm:"type:varchar(255)" csv:"platform" json:"platform"`
	Language            string                `gorm:"type:varchar(255)" csv:"language" json:"language"`
}

Paper : https://github.com/offensive-security/exploitdb-papers/blob/master/files_papers.csv

type ShellCode

type ShellCode struct {
	ID                  int64                 `json:"-"`
	OffensiveSecurityID int64                 `json:"-"`
	ExploitUniqueID     string                `gorm:"type:varchar(255)" csv:"id" json:"-"`
	ShellCodeURL        string                `gorm:"type:varchar(255)" csv:"file" json:"shell_code_url"`
	Description         string                `gorm:"type:text" csv:"description" json:"description"`
	Date                OffensiveSecurityTime `gorm:"type:time" csv:"date" json:"date"`
	Author              string                `gorm:"type:varchar(255)" csv:"author" json:"author"`
	Platform            string                `gorm:"type:varchar(255)" csv:"platform" json:"platform"`
}

ShellCode : https://github.com/offensive-security/exploitdb/tree/master/shellcodes

Jump to

Keyboard shortcuts

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