finger

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertInto added in v1.0.17

func InsertInto(s string, interval int, sep rune) string

func MatchWpPlugin added in v1.0.34

func MatchWpPlugin(banner *Banner) map[string]map[string]string

func NewClient added in v1.0.29

func NewClient(proxy string, timeout time.Duration) (*http.Client, error)

func NewTransport added in v1.0.29

func NewTransport(proxyURL string) (transport *http.Transport, err error)

func ResponseDecoding

func ResponseDecoding(body []byte, label string) string

Types

type AppFinger

type AppFinger struct {
	Rules []*Rule

	Proxy string
	// contains filtered or unexported fields
}

func New

func New(options *Options) *AppFinger

func (*AppFinger) AddFinger

func (f *AppFinger) AddFinger(content string) error

func (*AppFinger) LoadAppFinger

func (f *AppFinger) LoadAppFinger(directory string)

func (*AppFinger) Match

func (f *AppFinger) Match(banner *Banner) map[string]map[string]string

func (*AppFinger) MatchURI

func (f *AppFinger) MatchURI(uri string) (banner *Banner, fingerprints map[string]map[string]string, err error)
type Banner struct {
	Uri         string            `json:"uri"`
	BodyHash    int32             `json:"body_hash"`
	Body        string            `json:"-"`
	Header      string            `json:"-"`
	Headers     map[string]string `json:"-"`
	Title       string            `json:"title"`
	StatusCode  int               `json:"status_code"`
	Response    string            `json:"response"`
	SSL         bool              `json:"ssl"`
	Certificate string            `json:"certificate"`
	IconHash    int32             `json:"icon_hash"`
}

func Request

func Request(uri string, timeout time.Duration, proxyURL string, disableIcon bool, debugResp bool) ([]*Banner, error)

func RequestOnce added in v1.0.42

func RequestOnce(client *http.Client, uri string) (banner *Banner, redirectURL string, err error)

type Options

type Options struct {
	Timeout           time.Duration
	Home              string
	Proxy             string
	DisableJavaScript bool
	DisableIcon       bool
	DebugResp         bool
}

type Rule

type Rule struct {
	Name              string `json:"name,omitempty"`
	MatchersCondition string `yaml:"matchers-condition" json:"matchers_condition,omitempty"`
	// 组件太多  采用层级匹配 优化匹配速度
	Require  []string            `json:"require,omitempty"`
	Matchers []*matchers.Matcher `json:"matchers,omitempty"`
}

func (*Rule) Match

func (r *Rule) Match(banner *Banner) (bool, map[string]string)

Jump to

Keyboard shortcuts

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