fingers

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 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 PresetExtracts = map[string]*regexp.Regexp{
	"url":      regexp.MustCompile(`(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?`),
	"ip":       regexp.MustCompile("((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}"),
	"mail":     regexp.MustCompile("([A-Za-z0-9_\\-\\.\u4e00-\u9fa5])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,8})"),
	"idcard":   regexp.MustCompile("(\\d{15}$)|(^\\d{17}([0-9]|[xX]))"),
	"phone":    regexp.MustCompile("(\\+?0?86\\-?)?1[3-9]\\d{9}"),
	"header":   regexp.MustCompile("(?U)^HTTP(?:.|\n)*[\r\n]{4}"),
	"body":     regexp.MustCompile("[\\r\\n]{4}[\\w\\W]*"),
	"cookie":   regexp.MustCompile("(?i)Set-Cookie.*"),
	"response": regexp.MustCompile("(?s).*"),
}

Functions

func FingerMatcher

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

func RuleMatcher

func RuleMatcher(rule *Rule, content string, ishttp bool) (bool, bool, string)

Types

type Extracted added in v2.8.6

type Extracted struct {
	Name          string   `json:"name"`
	ExtractResult []string `json:"extract_result"`
}

func NewExtracted added in v2.8.6

func NewExtracted(name string, extractResult interface{}) *Extracted

func (*Extracted) ToString added in v2.8.6

func (e *Extracted) ToString() string

type Extractors added in v2.8.6

type Extractors map[string]*regexp.Regexp

func (Extractors) Extract added in v2.8.6

func (e Extractors) Extract(content string) (extracts []*Extracted)

type Favicons

type Favicons struct {
	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"`
	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"`
}

func (*Finger) Compile

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

func (*Finger) Match added in v2.8.5

func (finger *Finger) Match(content string, level int, sender func([]byte) (string, 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)

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"`
	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 added in v2.9.1

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:"-"`
}

func (*Rule) Match added in v2.8.5

func (rule *Rule) Match(content string, ishttp bool) (bool, bool, string)

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