fingers

package
v2.12.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = iota
	ACTIVE
	ICO
	NOTFOUND
	GUESS
)
View Source
const (
	INFO int = iota + 1
	MEDIUM
	HIGH
	CRITICAL
)

Variables

View Source
var (
	Md5Fingers  map[string]string
	Mmh3Fingers map[string]string
	OPSEC       = false
	FingerLog   = logs.Log
)

Functions

func FaviconActiveMatch

func FaviconActiveMatch(favicon *Favicons, level int, sender func(string) ([]byte, bool)) (*parsers.Framework, bool)

func FaviconMatch

func FaviconMatch(content map[string]string) (*parsers.Framework, bool)

func FingerMatcher

func FingerMatcher(finger *Finger, content map[string]interface{}, level int, sender func([]byte) ([]byte, bool)) (*parsers.Framework, *parsers.Vuln, bool)

func RuleMatcher

func RuleMatcher(rule *Rule, content map[string]interface{}, ishttp bool) (bool, bool, string)

Types

type Favicons

type Favicons struct {
	Path string   `yaml:"path,omitempty" json:"path,omitempty"`
	Mmh3 []string `yaml:"mmh3,omitempty" json:"mmh3,omitempty"`
	Md5  []string `yaml:"md5,omitempty" json:"md5,omitempty"`
}

type Finger

type Finger struct {
	Name        string   `yaml:"name" json:"name"`
	Protocol    string   `yaml:"protocol,omitempty" json:"protocol"`
	Link        string   `yaml:"link,omitempty" json:"link,omitempty"`
	DefaultPort []string `yaml:"default_port,omitempty" json:"default_port,omitempty"`
	Focus       bool     `yaml:"focus,omitempty" json:"focus,omitempty"`
	Rules       Rules    `yaml:"rule,omitempty" json:"rule,omitempty"`
	Tags        []string `yaml:"tag,omitempty" json:"tag,omitempty"`
	Opsec       bool     `yaml:"opsec,omitempty" json:"opsec,omitempty"`
	IsActive    bool     `yaml:"-" json:"-"`
}

func (*Finger) Compile

func (finger *Finger) Compile(portHandler func([]string) []string) error

func (*Finger) Match

func (finger *Finger) Match(content map[string]interface{}, level int, sender func([]byte) ([]byte, bool)) (*parsers.Framework, *parsers.Vuln, bool)

func (*Finger) ToResult

func (finger *Finger) ToResult(hasFrame, hasVuln bool, res string, index int) (frame *parsers.Framework, vuln *parsers.Vuln)

type FingerMapper

type FingerMapper map[string][]*Finger

type Fingers

type Fingers []*Finger

func LoadFingers

func LoadFingers(content []byte) (fingers Fingers, err error)

LoadFingers 加载指纹 迁移到fingers包从, 允许其他服务调用

func (Fingers) GroupByMod

func (fs Fingers) GroupByMod() (Fingers, Fingers)

func (Fingers) GroupByPort

func (fs Fingers) GroupByPort() FingerMapper

type Regexps

type Regexps struct {
	Body                  []string         `yaml:"body,omitempty" json:"body,omitempty"`
	MD5                   []string         `yaml:"md5,omitempty" json:"md5,omitempty"`
	MMH3                  []string         `yaml:"mmh3,omitempty" json:"mmh3,omitempty"`
	Regexp                []string         `yaml:"regexp,omitempty" json:"regexp,omitempty"`
	Version               []string         `yaml:"version,omitempty" json:"version,omitempty"`
	Cert                  []string         `yaml:"cert,omitempty" json:"cert,omitempty"`
	CompliedRegexp        []*regexp.Regexp `yaml:"-" json:"-"`
	CompiledVulnRegexp    []*regexp.Regexp `yaml:"-" json:"-"`
	CompiledVersionRegexp []*regexp.Regexp `yaml:"-" json:"-"`
	FingerName            string           `yaml:"-" json:"-"`
	Header                []string         `yaml:"header,omitempty" json:"header,omitempty"`
	Vuln                  []string         `yaml:"vuln,omitempty" json:"vuln,omitempty"`
}

func (*Regexps) Compile

func (r *Regexps) Compile() error

type Rule

type Rule struct {
	Version     string    `yaml:"version,omitempty" json:"version,omitempty"`
	Favicon     *Favicons `yaml:"favicon,omitempty" json:"favicon,omitempty"`
	Regexps     *Regexps  `yaml:"regexps,omitempty" json:"regexps,omitempty"`
	SendDataStr string    `yaml:"send_data,omitempty" json:"send_data,omitempty"`
	SendData    senddata  `yaml:"-" json:"-"`
	Info        string    `yaml:"info,omitempty" json:"info,omitempty"`
	Vuln        string    `yaml:"vuln,omitempty" json:"vuln,omitempty"`
	Level       int       `yaml:"level,omitempty" json:"level,omitempty"`
	FingerName  string    `yaml:"-" json:"-"`
	IsActive    bool      `yaml:"-" json:"-"`
}

func (*Rule) Compile

func (r *Rule) Compile(name string) error

func (*Rule) Match

func (r *Rule) Match(content []byte, ishttp bool) (bool, bool, string)

func (*Rule) MatchCert

func (r *Rule) MatchCert(content string) bool

type Rules

type Rules []*Rule

func (Rules) Compile

func (rs Rules) Compile(name string) error

Jump to

Keyboard shortcuts

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