Documentation
¶
Index ¶
- Constants
- Variables
- func FingerMatcher(finger *Finger, content string, level int, sender func([]byte) (string, bool)) (*parsers.Framework, *parsers.Vuln, bool)
- func RuleMatcher(rule *Rule, content string, ishttp bool) (bool, bool, string)
- type Extracted
- type Extractors
- type Favicons
- type Finger
- func (finger *Finger) Compile(portHandler func([]string) []string) error
- func (finger *Finger) Match(content string, level int, sender func([]byte) (string, bool)) (*parsers.Framework, *parsers.Vuln, bool)
- func (finger *Finger) ToResult(hasFrame, hasVuln bool, res string, index int) (frame *parsers.Framework, vuln *parsers.Vuln)
- type FingerMapper
- type Fingers
- type Regexps
- type Rule
- type Rules
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 ¶
Types ¶
type Extracted ¶ added in v2.8.6
func NewExtracted ¶ added in v2.8.6
type Extractors ¶ added in v2.8.6
func (Extractors) Extract ¶ added in v2.8.6
func (e Extractors) Extract(content string) (extracts []*Extracted)
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"`
}
type FingerMapper ¶
type Fingers ¶
type Fingers []*Finger
func LoadFingers ¶
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"`
}
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:"-"`
}
Click to show internal directories.
Click to hide internal directories.