portscan

package
v0.0.0-...-7ef1397 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrameFromDefault = iota
	FrameFromACTIVE
	FrameFromICO
	FrameFromNOTFOUND
	FrameFromGUESS
)
View Source
const (
	IpOpenedPortFilterNumber = 50 // IP开放端口数量,超过该数量则认为存在安全设备过滤
)

Variables

This section is empty.

Functions

func FilterIPHasTooMuchPort

func FilterIPHasTooMuchPort(result *Result, isOnline bool)

FilterIPHasTooMuchPort 过滤有安全防护、显示太多端口开放的IP

func MapToString

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

func UnFlat

func UnFlat(input []byte) []byte

Types

type Config

type Config struct {
	Target           string `json:"target"`
	ExcludeTarget    string `json:"executeTarget"`
	Port             string `json:"port"`
	OrgId            *int   `json:"orgId"`
	Rate             int    `json:"rate"`
	IsPing           bool   `json:"ping"`
	Tech             string `json:"tech"`
	IsIpLocation     bool   `json:"ipLocation"`
	IsHttpx          bool   `json:"httpx"`
	IsScreenshot     bool   `json:"screenshot"`
	IsFingerprintHub bool   `json:"fingerprinthub"`
	IsIconHash       bool   `json:"iconhash"`
	IsFingerprintx   bool   `json:"fingerprintx"`
	CmdBin           string `json:"cmdBin"`
	IsLoadOpenedPort bool   `json:"loadOpenedPort"`
	IsPortscan       bool   `json:"isPortscan"`
	WorkspaceId      int    `json:"workspaceId"`
	IsProxy          bool   `json:"proxy"`
}

Config 端口扫描的参数配置

type FScan

type FScan struct {
}

FScan 导入fscan的扫描结果

func (*FScan) ParseContentResult

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

ParseContentResult 解析fscan扫描的文本结果

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 {
}

func (*Goby) ParseContentResult

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

ParseContentResult 获取资产扫描结果

type GobyAssertPortInfo

type GobyAssertPortInfo 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"`
}

GobyAssertPortInfo 端口信息

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]GobyAssertPortInfo `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 Gogo

type Gogo struct {
	Config    Config
	Result    Result
	VulResult []pocscan.Result
}

Gogo 导入gogo的扫描结果

func NewGogo

func NewGogo(config Config) *Gogo

NewGogo 创建gogo对象

func (*Gogo) Do

func (g *Gogo) Do()

func (*Gogo) ParseContentResult

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

ParseContentResult 解析gogo扫描的文本结果

type HttpResult

type HttpResult struct {
	RelatedId int
	Source    string
	Tag       string
	Content   string
}

type IPResult

type IPResult struct {
	OrgId    *int
	Location string
	Status   string
	Ports    map[int]*PortResult
}

IPResult IP结果

type ImportOfflineResult

type ImportOfflineResult struct {
	IpResult Result
	// contains filtered or unexported fields
}

func NewImportOfflineResult

func NewImportOfflineResult(resultType string) *ImportOfflineResult

func NewImportOfflineResultWithInterface

func NewImportOfflineResultWithInterface(resultType string, resultInterface OfflineResult) *ImportOfflineResult

func (*ImportOfflineResult) Parse

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

type Masscan

type Masscan struct {
	Config Config
	Result Result
}

func NewMasscan

func NewMasscan(config Config) *Masscan

NewMasscan 创建masscan对象

func (*Masscan) Do

func (m *Masscan) Do()

Do 执行masscan

func (*Masscan) ParseContentResult

func (m *Masscan) ParseContentResult(content []byte) (result Result)

ParseContentResult 解析XML格式的masscan扫描结果

type Nmap

type Nmap struct {
	Config Config
	Result Result
}

func NewNmap

func NewNmap(config Config) *Nmap

NewNmap 创建nmap对象

func (*Nmap) Do

func (nmap *Nmap) Do()

Do 执行nmap

func (*Nmap) ParseContentResult

func (nmap *Nmap) ParseContentResult(content []byte) (result Result)

ParseContentResult 解析nmap的XML文件

func (*Nmap) RunNmap

func (nmap *Nmap) RunNmap(targets []string, ipv6 bool)

RunNmap 调用并执行一次nmap

type OfflineResult

type OfflineResult interface {
	ParseContentResult(content []byte) (ipResult Result)
}

type PortAttrResult

type PortAttrResult struct {
	RelatedId int
	Source    string
	Tag       string
	Content   string
}

PortAttrResult 端口属性结果

type PortResult

type PortResult struct {
	Status    string
	PortAttrs []PortAttrResult
	HttpInfo  []HttpResult
}

PortResult 端口结果

type Result

type Result struct {
	sync.RWMutex
	IPResult map[string]*IPResult
}

Result 端口扫描结果

func (*Result) HasIP

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

func (*Result) HasPort

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

func (*Result) SaveResult

func (r *Result) SaveResult(config Config) string

SaveResult 保存端口扫描的结果到数据库

func (*Result) SetIP

func (r *Result) SetIP(ip string)

func (*Result) SetPort

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

func (*Result) SetPortAttr

func (r *Result) SetPortAttr(ip string, port int, par PortAttrResult)

func (*Result) SetPortHttpInfo

func (r *Result) SetPortHttpInfo(ip string, port int, result HttpResult)

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

Jump to

Keyboard shortcuts

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