pocscan

package
v0.0.0-...-0b9a7cd Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 29 Imported by: 5

Documentation

Index

Constants

View Source
const (
	APITaskList         = "/api/v1/tasks"
	APIStartScan        = "/api/v1/startScan"
	APIGetAsset         = "/api/v1/assetSearch"
	APIGetVulnerability = "/api/v1/vulnerabilitySearch"
	APIProgress         = "/api/v1/getProgress"
	// SleepDelayTimeSecond 任务执行出错时的休眠间隔
	SleepDelayTimeSecond = 10
	// CheckProgressTimeSecond 检查任务执行结果的时间
	CheckProgressTimeSecond = 10
	// StartScanRandWaitTimeSecond 同时多个任务开始时,goby可能冲突会导致返回相同的taskid
	StartScanRandWaitTimeSecond = 10
)
View Source
const (
	FrameFromDefault = iota
	FrameFromACTIVE
	FrameFromICO
	FrameFromNOTFOUND
	FrameFromGUESS
)

Variables

This section is empty.

Functions

func MapToString

func MapToString(m map[string]interface{}) string

func SaveResult

func SaveResult(result []Result) string

SaveResult 保存结果

func UnFlat

func UnFlat(input []byte) []byte

Types

type AssertPortInfo

type AssertPortInfo struct {
	Port      string   `json:"port"`
	Hostinfo  string   `json:"hostinfo"`
	Url       string   `json:"url"`
	Product   string   `json:"product"`
	Protocol  string   `json:"protocol"`
	Json      string   `json:"json"`
	Fid       []string `json:"fid"`
	Products  []string `json:"products"`
	Protocols []string `json:"protocols"`
}

AssertPortInfo 端口信息

type Config

type Config struct {
	Target           string `json:"target"`
	PocFile          string `json:"pocFile"`
	CmdBin           string `json:"cmdBin"`
	IsLoadOpenedPort bool   `json:"loadOpenedPort"`
	WorkspaceId      int    `json:"workspaceId"`
	IsProxy          bool   `json:"proxy"`
}

type DomainResult

type DomainResult struct {
	Vuls []string
}

DomainResult 域名结果

type DomainscanVulResult

type DomainscanVulResult struct {
	sync.RWMutex `json:"-"`
	DomainResult map[string]*DomainResult
}

DomainscanVulResult 域名结果

func (*DomainscanVulResult) HasDomain

func (r *DomainscanVulResult) HasDomain(domain string) bool

func (*DomainscanVulResult) SetDomain

func (r *DomainscanVulResult) SetDomain(domain string)

func (*DomainscanVulResult) SetDomainVul

func (r *DomainscanVulResult) SetDomainVul(domain string, vul string)

type FScan

type FScan struct {
}

func (*FScan) ParseContentResult

func (f *FScan) ParseContentResult(content []byte) (result []Result)

type Framework

type Framework struct {
	Name    string       `json:"name"`
	Version string       `json:"version,omitempty"`
	From    int          `json:"-"`
	Froms   map[int]bool `json:"froms,omitempty"`
	Tags    []string     `json:"tags,omitempty"`
	IsFocus bool         `json:"is_focus,omitempty"`
	Data    string       `json:"-"`
}

func (*Framework) String

func (f *Framework) String() string

type Frameworks

type Frameworks map[string]*Framework

func (Frameworks) String

func (fs Frameworks) String() string

type GOGOConfig

type GOGOConfig struct {
	IP            string   `json:"ip"`
	IPlist        []string `json:"ips"`
	Ports         string   `json:"ports"`
	JsonFile      string   `json:"json_file"`
	ListFile      string   `json:"list_file"`
	Threads       int      `json:"threads"` // 线程数
	Mod           string   `json:"mod"`     // 扫描模式
	AliveSprayMod []string `json:"alive_spray"`
	PortSpray     bool     `json:"port_spray"`
	Exploit       string   `json:"exploit"`
	JsonType      string   `json:"json_type"`
	VersionLevel  int      `json:"version_level"`
}

type GOGOData

type GOGOData struct {
	Config GOGOConfig  `json:"config"`
	IP     string      `json:"ip"`
	Data   GOGOResults `json:"data"`
}

type GOGOResult

type GOGOResult struct {
	Ip         string              `json:"ip"`                   // ip
	Port       string              `json:"port"`                 // port
	Uri        string              `json:"uri,omitempty"`        // uri
	Os         string              `json:"os,omitempty"`         // os
	Host       string              `json:"host,omitempty"`       // host
	Frameworks Frameworks          `json:"frameworks,omitempty"` // framework
	Vulns      Vulns               `json:"vulns,omitempty"`
	Extracteds map[string][]string `json:"extracted,omitempty"`
	Protocol   string              `json:"protocol"` // protocol
	Status     string              `json:"status"`   // http_stat
	Language   string              `json:"language"`
	Title      string              `json:"title"`   // title
	Midware    string              `json:"midware"` // midware
}

type GOGOResults

type GOGOResults []*GOGOResult

type Goby

type Goby struct {
	Config        Config
	Result        []Result
	AssertContent []byte
	// contains filtered or unexported fields
}

func NewGoby

func NewGoby(config Config) *Goby

NewGoby 创建goby对象

func (*Goby) Do

func (g *Goby) Do()

Do 调用goby执行一次scan

func (*Goby) GetAsset

func (g *Goby) GetAsset(api string, taskId string) (content []byte, err error)

GetAsset 获取扫描结果的资产信息,返回[]byte的结果

func (*Goby) GetTaskList

func (g *Goby) GetTaskList(api string) (err error)

GetTaskList 获取任务列表

func (*Goby) GetVulnerability

func (g *Goby) GetVulnerability(api string, taskId string) (err error)

GetVulnerability 获取扫描漏洞结果

func (*Goby) StartScan

func (g *Goby) StartScan(ips []string) (taskId string, api string, err error)

StartScan 执行一次扫描,并等待扫描结束后返回

type GobyAssetSearchRequest

type GobyAssetSearchRequest struct {
	Query   string `json:"query"`
	Options struct {
		Page struct {
			Page int `json:"page"`
			Size int `json:"size"`
		} `json:"page"`
	} `json:"options"`
}

GobyAssetSearchRequest 获取扫描端口信息请求参数

type GobyAssetSearchResponse

type GobyAssetSearchResponse struct {
	StatusCode int    `json:"statusCode"`
	Messages   string `json:"messages"`
	Data       struct {
		Ips []struct {
			Ip       string `json:"ip"`
			Mac      string `json:"mac"`
			Os       string `json:"os"`
			Hostname string `json:"hostname"`
			Honeypot string `json:"honeypot,omitempty"`
			Ports    []struct {
				Port         string `json:"port"`
				Baseprotocol string `json:"baseprotocol"`
			} `json:"ports"`
			Protocols       map[string]AssertPortInfo `json:"protocols"`
			Vulnerabilities []struct {
				Hostinfo string `json:"hostinfo"`
				Name     string `json:"name"`
				Filename string `json:"filename"`
				Level    string `json:"level"`
				Vulurl   string `json:"vulurl"`
				Keymemo  string `json:"keymemo"`
				Hasexp   bool   `json:"hasexp "`
			} `json:"vulnerabilities"`
			Screenshots interface{} `json:"screenshots"`
			Favicons    interface{} `json:"favicons"`
			Hostnames   []string    `json:"hostnames"`
		} `json:"ips"`
	} `json:"data"`
}

GobyAssetSearchResponse 扫描端口信息返回

type GobyProgessRequest

type GobyProgessRequest struct {
	Taskid string `json:"taskid"`
}

GobyProgessRequest 扫描进度请求参数

type GobyProgressResponse

type GobyProgressResponse struct {
	StatusCode int    `json:"statusCode"`
	Messages   string `json:"messages"`
	Data       struct {
		Logs     interface{} `json:"logs"`
		Progress int         `json:"progress"`
		State    int         `json:"state"`
	} `json:"data"`
}

GobyProgressResponse 扫描进度返回结果

type GobyStartScanRequest

type GobyStartScanRequest struct {
	Asset struct {
		Ips      []string `json:"ips"`
		Ports    string   `json:"ports"`
		BlackIps []string `json:"blackIps"`
	} `json:"asset"`
	Vulnerability struct {
		//-vulmode int
		//vulmode: 	0 general(no bruteforce, but include webvulscan),
		//			1 only_burte_pocs,
		//			2 all_pocs,
		//			3 only_list_pocs,
		//			4 only_webvulscan,
		//			5 only_appvul,
		//			-1 disable
		Type string `json:"type"`
	} `json:"vulnerability"`
	Options struct {
		Random bool `json:"random,omitempty"`
		Rate   int  `json:"rate,omitempty"`
		//-hostListMode
		//    	whether enable hostListMode, which targets is hostinfo list, aka Fast mode
		HostListMode bool `json:"hostListMode,omitempty"`
		//-portscanmode intport scan mode: 0 is pcap, 1 is tcpudp
		Portscanmode  int  `json:"portscanmode,omitempty"`
		CheckHoneyPot bool `json:"CheckHoneyPot,omitempty"`
		PingFirst     bool `json:"pingFirst,omitempty"`
		//-pingCheckSize int
		//    	ping check size, only valid when set pingfirst (default 10)
		//  -pingConcurrent int
		//    	ping concurrent, only valid when set pingfirst (default 2)
		//  -pingSendCount int
		//    	ping senbd count, only valid when set pingfirst (default 2)
		PingCheckSize    int    `json:"pingCheckSize,omitempty"`
		PingConcurrent   int    `json:"pingConcurren,omitempty"`
		PingSendCount    int    `json:"pingSendCount,omitempty"`
		DefaultUserAgent string `json:"defaultUserAgent,omitempty"`
		SocketTimeout    int    `json:"socketTimeout,omitempty"`
		RetryTimes       int    `json:"retryTimes,omitempty"`
		CheckAliveMode   int    `json:"checkAliveMode,omitempty"`
	} `json:"options"`
}

GobyStartScanRequest 扫描任务请求参数

type GobyStartScanResponse

type GobyStartScanResponse struct {
	StatusCode int    `json:"statusCode"`
	Messages   string `json:"messages"`
	Data       struct {
		TaskId string `json:"taskId"`
	} `json:"data"`
}

GobyStartScanResponse 扫描任务启动的返回结果

type GobyVulnerabilityRequest

type GobyVulnerabilityRequest struct {
	TaskId  string `json:"taskId"`
	Type    string `json:"type"`
	Query   string `json:"query"`
	Options struct {
		Page struct {
			Page int `json:"page"`
			Size int `json:"size"`
		} `json:"page"`
	} `json:"options"`
}

GobyVulnerabilityRequest 扫描结果中的漏洞信息请求参数

type GobyVulnerabilityResponse

type GobyVulnerabilityResponse struct {
	StatusCode int    `json:"statusCode"`
	Messages   string `json:"messages"`
	Data       struct {
		Total struct {
			Ips             int `json:"ips"`
			Vulnerabilities int `json:"vulnerabilities"`
		} `json:"total"`
		Lists []struct {
			Name  string `json:"name"`
			Nums  int    `json:"nums"`
			Lists []struct {
				Hostinfo string `json:"hostinfo"`
				Name     string `json:"name"`
				Filename string `json:"filename"`
				Level    string `json:"level,omitempty"`
				Vulurl   string `json:"vulurl,omitempty"`
				Keymemo  string `json:"keymemo,omitempty"`
				Hasexp   bool   `json:"hasexp,omitempty"`
			} `json:"lists"`
		} `json:"lists"`
	} `json:"data"`
}

GobyVulnerabilityResponse 扫描结果中的漏洞结果

type Gogo

type Gogo struct {
}

Gogo 导入gogo的扫描结果

func (*Gogo) ParseContentResult

func (g *Gogo) ParseContentResult(content []byte) (result []Result)

ParseContentResult 解析gogo扫描的文本结果

type IPResult

type IPResult struct {
	Ports map[int]*PortResult
}

IPResult IP的端口结果

type ImportOfflineResult

type ImportOfflineResult struct {
	VulResult []Result
	// contains filtered or unexported fields
}

func NewImportOfflineResult

func NewImportOfflineResult(resultType string, workspaceId int) *ImportOfflineResult

func (*ImportOfflineResult) Parse

func (i *ImportOfflineResult) Parse(content []byte)

type Nuclei

type Nuclei struct {
	Config Config
	Result []Result
}

func NewNuclei

func NewNuclei(config Config) *Nuclei

func (*Nuclei) Do

func (n *Nuclei) Do()

func (*Nuclei) LoadPocFile

func (n *Nuclei) LoadPocFile() (pocs []string)

LoadPocFile 加载poc文件列表

type OfflineVulResult

type OfflineVulResult interface {
	ParseContentResult(content []byte) (vulResult []Result)
}

type PortResult

type PortResult struct {
	Vuls []string
}

PortResult 端口结果

type PortscanVulResult

type PortscanVulResult struct {
	sync.RWMutex `json:"-"`
	IPResult     map[string]*IPResult
}

PortscanVulResult ip结果

func (*PortscanVulResult) HasIP

func (r *PortscanVulResult) HasIP(ip string) bool

func (*PortscanVulResult) HasPort

func (r *PortscanVulResult) HasPort(ip string, port int) bool

func (*PortscanVulResult) SetIP

func (r *PortscanVulResult) SetIP(ip string)

func (*PortscanVulResult) SetPort

func (r *PortscanVulResult) SetPort(ip string, port int)

func (*PortscanVulResult) SetPortVul

func (r *PortscanVulResult) SetPortVul(ip string, port int, vul string)

type Result

type Result struct {
	Target      string `json:"target"`
	Url         string `json:"url"`
	PocFile     string `json:"pocFile"`
	Source      string `json:"source"`
	Extra       string `json:"extra"`
	WorkspaceId int    `json:"workspaceId"`
}

type Vuln

type Vuln struct {
	Name          string                 `json:"name"`
	Payload       map[string]interface{} `json:"payload,omitempty"`
	Detail        map[string]interface{} `json:"detail,omitempty"`
	SeverityLevel int                    `json:"severity"`
}

func (*Vuln) GetDetail

func (v *Vuln) GetDetail() string

func (*Vuln) GetPayload

func (v *Vuln) GetPayload() string

func (*Vuln) String

func (v *Vuln) String() string

type Vulns

type Vulns []*Vuln

type Xray

type Xray struct {
	Config Config
	Result []Result
}

func NewXray

func NewXray(config Config) *Xray

NewXray 创建xray对象

func (*Xray) Do

func (x *Xray) Do()

Do 调用xray执行一次webscan

func (*Xray) LoadDefaultPocFile

func (x *Xray) LoadDefaultPocFile() (pocs []string)

LoadDefaultPocFile 加载xray内置的poc文件列表

func (*Xray) LoadPocFile

func (x *Xray) LoadPocFile() (pocs []string)

LoadPocFile 加载poc文件列表

Jump to

Keyboard shortcuts

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