finger

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const JSExecuteTemplate = `` /* 813-byte string literal not displayed */

Variables

This section is empty.

Functions

func ExtractCharset added in v1.1.6

func ExtractCharset(htmlContent string) string

func ExtractContentTypeCharset added in v1.1.6

func ExtractContentTypeCharset(contentType string) (charset string)

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(options ...ClientOption) (*http.Client, error)

func NewTransport added in v1.0.29

func NewTransport(uri string) (*http.Transport, error)

NewTransport 创建一个带有 SOCKS5 代理的 http.Transport

func ResponseDecoding

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

Types

type AppFinger

type AppFinger struct {
	Rules   []*Rule
	Plugins []*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) ExecuteWithPlugin added in v1.2.11

func (f *AppFinger) ExecuteWithPlugin(banner *Banner, plugin *RulePlugin) ([]*Banner, error)

func (*AppFinger) LoadAppFinger

func (f *AppFinger) LoadAppFinger(directory string)

func (*AppFinger) Match

func (f *AppFinger) Match(banner *Banner, rules []*Rule) RuleResult

func (*AppFinger) MatchPlugin added in v1.2.11

func (f *AppFinger) MatchPlugin(banner *Banner) []*RulePlugin

func (*AppFinger) MatchRule added in v1.2.11

func (f *AppFinger) MatchRule(banner *Banner) RuleResult

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:"body"`
	Header      string               `json:"header"`
	Headers     map[string]string    `json:"-"`
	Title       string               `json:"title"`
	StatusCode  int                  `json:"status_code"`
	Response    string               `json:"_"`
	SSL         bool                 `json:"ssl"`
	Certificate string               `json:"certificate"`
	IconHash    int32                `json:"icon_hash"`
	IconType    string               `json:"icon_type"`
	Charset     string               `json:"-"`
	Cert        *tls.ConnectionState `json:"-"`
	IconURI     string               `json:"icon_uri"`
	IconBytes   []byte               `json:"-"`
}

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 ClientOption added in v1.2.12

type ClientOption func(*http.Client) error

func WithProxy added in v1.2.12

func WithProxy(proxy string) ClientOption

WithProxy 配置代理

func WithRedirectPolicy added in v1.2.12

func WithRedirectPolicy(policy func(req *http.Request, via []*http.Request) error) ClientOption

WithRedirectPolicy 自定义重定向策略

func WithTimeout added in v1.2.12

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout 配置超时时间

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"`
	Plugins  []*RulePlugin       `yaml:"plugins"`
}

func (*Rule) Match

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

type RulePlugin added in v1.2.11

type RulePlugin struct {
	Path string `yaml:"path" json:"path,omitempty"`
}

type RuleResult added in v1.2.11

type RuleResult struct {
	Extract map[string]map[string]string
	Plugins []*RulePlugin
}

Jump to

Keyboard shortcuts

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