model.go 3.65 KB
Newer Older
qiuqunfeng's avatar
qiuqunfeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
package model

// type TagsType string

const (
// C2       TagsType = "C2"
// Hijacked TagsType = "Hijacked"
)

type Port struct {
	Port    int16  `json:"port"`
	Module  string `json:"module"`
	Product string `json:"product"`
	Version string `json:"version"`
	Detail  string `json:"detail"`
}

type Location struct {
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Province    string  `json:"province"`
	City        string  `json:"city"`
	Longitude   float64 `json:"longitude"`
	Latitude    float64 `json:"latitude"`
}

type Sample struct {
	Hash          string `json:"hash"`
	ScanTime      int64  `json:"scanTime"`
	Ratio         string `json:"ratio"`
	MalwareType   string `json:"malwareType"`
	MalwareFamily string `json:"malwareFamily"`
}

type CAS struct {
	Protocol           string      `json:"protocol"`
	Port               int16       `json:"port"`
	Period             int         `json:"period"`
	DigitalCertificate Certificate `json:"digitalCertificate"`
}

type Certificate struct {
	Subject      string `json:"subject"`
	Issuer       string `json:"issuer"`
	Fingerprint  string `json:"fingerprint"`
	Purpose      string `json:"purpose"`
	Verify       string `json:"verify"`
	Status       string `json:"status"`
	Revoked      bool   `json:"revoked"`
	Begin        string `json:"begin"`
	End          string `json:"end"`
	StatusDesc   string `json:"statusDesc"`
	SerialNumber string `json:"serialNumber"`
	RevokedTime  string `json:"revokedTime"`
}

type TagsClass struct {
	TagsType string `json:"tagsType"` //标签类别,如"industry(行业)"、"gangs(团伙)"、"virus_family(家族)"等
	Tags     string `json:"tags"`     //具体的攻击团伙或安全事件标签,例如:APT、海莲花等。
}

type ASN struct {
	Number   int    `json:"number"` //ASN号码
	Name     string `json:"name"`
	Company  string `json:"Company"`
	Region   string `json:"region"`
	Info     string `json:"info"`     // ASN名称 + ASN归属公司 + RIR登记区域
	RiskRank int    `json:"riskRank"` //风险值(0~4,越大代表风险越高)
}

type Intelligence struct {
	Source     string      `json:"source"`
	FindTime   int64       `json:"findTime"`
	UpdateTime int64       `json:"updateTime"`
	Confidence int         `json:"confidence"`
	Expired    bool        `json:"expired"`
	IntelTypes []string    `json:"intelTypes"` //威胁类型
	IntelTags  []TagsClass `json:"intelTags"`  //情报的标签信息
}

type RDNS struct {
	RDNS    string `json:"rdns"`
	GetTime string `json:"getTime"`
}

type IPInfo struct {
	Carrier             string         `json:"carrier"`             // 运营商
	Location            Location       `json:"location"`            // 位置信息
	OSSIntelligences    []Intelligence `json:"ossIntelligences"`    // 开源情报
	OnlineIntelligences []Intelligence `json:"onlineIntelligences"` // 在线情报
	Ports               []Port         `json:"ports"`               //开发端口
	Samples             []Sample       `json:"samples"`             // 相关样本
	Cas                 []CAS          `json:"cas"`                 // SSL相关证书信息
	Rdnses              []RDNS         `json:"rdnses"`              // Rdns记录
	TagsClasses         []TagsClass    `json:"tagsClasses"`         //相关攻击团伙或安全事件信息
	Scene               string         `json:"scene"`               //应用场景
	Asn                 ASN            `json:"asn"`                 //asn信息
	SumCurDomains       int            `json:"sumCurDomains"`       //反查当前域名数量
	IsMalicious         bool           `json:"isMalicious"`         //是否恶意
	Judgments           []string       `json:"judgments"`           // 威胁类型
}