pkg

package
v2.11.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: GPL-3.0 Imports: 25 Imported by: 4

Documentation

Index

Constants

View Source
const (
	SMART       = "s"       // 使用port-probe探测存活的c段, 递归下降到default
	SUPERSMART  = "ss"      // 使用ip-probe探测存活的b段, 递归下降到s
	SUPERSMARTC = "sb"      // 使用port-probe探测到c段后退出
	SUPERSMARTB = "sc"      // 使用ip-probe探测存活的b段,. 递归下降到sb
	Default     = "default" // 扫描完后退出
)

Variables

View Source
var (
	NameMap = utils.NameMap
	PortMap = utils.PortMap
	TagMap  = utils.TagMap
	//WorkFlowMap    map[string][]*Workflow
	Extractor      []*parsers.Extractor
	Extractors     = make(parsers.Extractors)
	ExtractRegexps = map[string][]*parsers.Extractor{}
)
View Source
var (
	Md5Fingers         map[string]string
	Mmh3Fingers        map[string]string
	AllHttpFingers     fingers.Fingers
	TcpFingers         fingers.FingerMapper
	HttpFingers        fingers.FingerMapper
	ActiveHttpFingers  fingers.Fingers
	PassiveHttpFingers fingers.Fingers
)
View Source
var (
	Win  = iutils.IsWin()
	Mac  = iutils.IsMac()
	Root = iutils.IsRoot()
)
View Source
var ExecuterOptions *protocols.ExecuterOptions
View Source
var Proxy func(*http.Request) (*url.URL, error)
View Source
var ProxyDialTimeout func(network, address string, timeout time.Duration) (net.Conn, error)
View Source
var ProxyUrl *url.URL
View Source
var RandomDir = "/g8kZMwp4oeKsL2in"
View Source
var TemplateMap map[string][]*templates.Template

Functions

func CleanSpiltCFLR added in v2.10.4

func CleanSpiltCFLR(s string) []string

func CollectHttpInfo

func CollectHttpInfo(result *Result, resp *http.Response)

func CollectSocketInfo

func CollectSocketInfo(result *Result, socketContent []byte)

func Decode

func Decode(input string) []byte

func FormatCertDomains

func FormatCertDomains(domains []string) []string

func GetFilename

func GetFilename(config *Config, name string) string

func GetStatusCode

func GetStatusCode(content []byte) (bool, string)

GetStatusCode 从socket中获取http状态码

func HasPingPriv

func HasPingPriv() bool

func HttpConn

func HttpConn(delay int) *http.Client

func HttpConnWithNoRedirect added in v2.11.3

func HttpConnWithNoRedirect(delay int) *http.Client

func IsExist

func IsExist(filename string) bool

func LoadConfig

func LoadConfig(typ string) []byte

func LoadExtractor added in v2.10.4

func LoadExtractor()

func LoadFinger

func LoadFinger(t string) fingers.Fingers

LoadFinger 加载指纹到全局变量

func LoadHashFinger

func LoadHashFinger(fs fingers.Fingers) (map[string]string, map[string]string)

func LoadNeutron added in v2.10.7

func LoadNeutron(filename string) map[string][]*templates.Template

func LoadPortConfig

func LoadPortConfig()

func LoadResultFile

func LoadResultFile(file io.Reader) interface{}

func LoadTemplates

func LoadTemplates(content []byte) map[string][]*templates.Template

func ParserCmdPayload

func ParserCmdPayload(payloads []string) *protocols.ExecuterOptions

func WriteSmartResult

func WriteSmartResult(file *files.File, target string, ips []string)

Types

type Config

type Config struct {
	*parsers.GOGOConfig
	// ip
	CIDRs    utils.CIDRs `json:"-"`
	Excludes []string    `json:"-"`
	// port and probe
	//Ports         string   `json:"ports"` // 预设字符串
	PortList      []string `json:"-"` // 处理完的端口列表
	PortProbe     string   `json:"-"` // 启发式扫描预设探针
	PortProbeList []string `json:"-"` // 启发式扫描预设探针
	IpProbe       string   `json:"-"`
	IpProbeList   []uint   `json:"-"`

	// file
	IsListInput bool `json:"-"` // 从标准输入中读
	IsJsonInput bool `json:"-"` // 从标准输入中读
	NoSpray     bool `json:"-"`
	Compress    bool `json:"-"`

	// output
	FilePath       string              `json:"-"`
	Filename       string              `json:"-"`
	SmartBFilename string              `json:"-"`
	SmartCFilename string              `json:"-"`
	AlivedFilename string              `json:"-"`
	File           *File               `json:"-"`
	SmartBFile     *File               `json:"-"`
	SmartCFile     *File               `json:"-"`
	AliveFile      *File               `json:"-"`
	Tee            bool                `json:"-"`
	Outputf        string              `json:"-"`
	FileOutputf    string              `json:"-"`
	Filenamef      string              `json:"-"`
	Results        parsers.GOGOResults `json:"-"` // json反序列化后的,保存在内存中
	HostsMap       map[string][]string `json:"-"` // host映射表
	Filters        []string            `json:"-"`
	FilterOr       bool                `json:"-"`
	OutputFilters  [][]string          `json:"-"`
}

func (*Config) Close

func (config *Config) Close()

func (*Config) GetTarget

func (config *Config) GetTarget() string

func (*Config) GetTargetName

func (config *Config) GetTargetName() string

func (*Config) HasAlivedScan

func (config *Config) HasAlivedScan() bool

func (*Config) InitFile

func (config *Config) InitFile() error

func (*Config) InitIP

func (config *Config) InitIP() error

func (*Config) IsBSmart

func (config *Config) IsBSmart() bool

func (*Config) IsCSmart added in v2.8.10

func (config *Config) IsCSmart() bool

func (*Config) IsScan

func (config *Config) IsScan() bool

func (*Config) IsSmart

func (config *Config) IsSmart() bool

func (*Config) ToJson

func (config *Config) ToJson(json_type string) string

func (*Config) Validate

func (config *Config) Validate() error

type PortFinger

type PortFinger struct {
	Name  string   `json:"name"`
	Ports []string `json:"ports"`
	Tags  []string `json:"tags"`
}

type PortMapResult added in v2.10.5

type PortMapResult map[string]*parsers.GOGOResult

func (PortMapResult) Get added in v2.10.5

func (imap PortMapResult) Get(port string) *parsers.GOGOResult

type Result

type Result struct {
	*parsers.GOGOResult
	HttpHosts   []string `json:"-"`
	CurrentHost string   `json:"-"`

	IsHttp     bool              `json:"-"`
	Open       bool              `json:"-"`
	SmartProbe bool              `json:"-"`
	TcpConn    *net.Conn         `json:"-"`
	HttpConn   *http.Client      `json:"-"`
	Httpresp   *parsers.Response `json:"-"`
	HasTitle   bool              `json:"-"`
	Error      string            `json:"-"`
	ErrStat    int               `json:"-"`
	Content    []byte            `json:"-"`
}

func NewResult

func NewResult(ip, port string) *Result

func (*Result) AddExtract

func (result *Result) AddExtract(extract *parsers.Extracted)

func (*Result) AddExtracts

func (result *Result) AddExtracts(extracts []*parsers.Extracted)

func (*Result) AddFramework

func (result *Result) AddFramework(f *parsers.Framework)

func (*Result) AddFrameworks

func (result *Result) AddFrameworks(fs []*parsers.Framework)

func (*Result) AddNTLMInfo

func (result *Result) AddNTLMInfo(m map[string]string, t string)

func (*Result) AddVuln

func (result *Result) AddVuln(vuln *parsers.Vuln)

func (*Result) AddVulns

func (result *Result) AddVulns(vulns []*parsers.Vuln)

func (*Result) ContentMap added in v2.11.0

func (result *Result) ContentMap() map[string]interface{}

func (*Result) GetHostBaseURL

func (result *Result) GetHostBaseURL() string

func (*Result) GetHostURL

func (result *Result) GetHostURL() string

func (*Result) GetHttpConn

func (result *Result) GetHttpConn(delay int) *http.Client

func (*Result) GuessFramework

func (result *Result) GuessFramework()

func (*Result) IsHttps

func (result *Result) IsHttps() bool

type ResultsData

type ResultsData struct {
	*parsers.GOGOData
}

func (*ResultsData) GetConfig added in v2.9.0

func (rd *ResultsData) GetConfig() *Config

func (*ResultsData) ToCobaltStrike

func (rd *ResultsData) ToCobaltStrike() string

func (*ResultsData) ToExtracteds added in v2.9.0

func (rd *ResultsData) ToExtracteds() string

func (*ResultsData) ToFormat

func (rd *ResultsData) ToFormat(isColor bool) string

type SmartResult added in v2.11.0

type SmartResult struct {
	Config *Config
	Data   map[string][]string `json:"data"`
}

func (*SmartResult) List added in v2.11.0

func (sr *SmartResult) List() []string

type Socket

type Socket struct {
	Conn    net.Conn
	Count   int
	Timeout time.Duration
}

func NewSocket

func NewSocket(network, target string, delay int) (*Socket, error)

func (*Socket) Close

func (s *Socket) Close()

func (*Socket) QuickRequest added in v2.10.5

func (s *Socket) QuickRequest(data []byte, max int) ([]byte, error)

func (*Socket) Read

func (s *Socket) Read(timeout int) ([]byte, error)

func (*Socket) Request

func (s *Socket) Request(data []byte, max int) ([]byte, error)

type Workflow

type Workflow struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	IP          string   `json:"ip"`
	IPlist      []string `json:"iplist"`
	Ports       string   `json:"ports"`
	Mod         string   `json:"mod"`
	Ping        bool     `json:"ping"`
	NoScan      bool     `json:"no-scan"`
	IpProbe     string   `json:"ip-probe"`
	SmartProbe  string   `json:"port-probe"`
	Exploit     string   `json:"exploit"`
	Verbose     int      `json:"verbose"`
	File        string   `json:"file"`
	Path        string   `json:"path"`
	Tags        []string `json:"tags"`
}

func ParseWorkflowsFromInput

func ParseWorkflowsFromInput(content []byte) []*Workflow

func (*Workflow) PrepareConfig

func (w *Workflow) PrepareConfig(rconfig Config) *Config

type WorkflowMap

type WorkflowMap map[string][]*Workflow

func LoadWorkFlow

func LoadWorkFlow() WorkflowMap

func (WorkflowMap) Choice

func (m WorkflowMap) Choice(name string) []*Workflow

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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