pkg

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Md5Fingers     map[string]string = make(map[string]string)
	Mmh3Fingers    map[string]string = make(map[string]string)
	ExtractRegexps                   = make(parsers.Extractors)
	Extractors                       = make(parsers.Extractors)

	FingerEngine *fingers.Engine
	ActivePath   []string
)
View Source
var (
	LogVerbose   = logs.Warn - 2
	LogFuzz      = logs.Warn - 1
	WhiteStatus  = []int{} // cmd input, 200
	BlackStatus  = []int{} // cmd input, 400,410
	FuzzyStatus  = []int{} // cmd input, 500,501,502,503
	WAFStatus    = []int{493, 418, 1020, 406}
	UniqueStatus = []int{} // 相同unique的403表示命中了同一条acl, 相同unique的200表示default页面

	// plugins
	EnableAllFingerEngine = false
)
View Source
var (
	Rules map[string]string = make(map[string]string)

	BadExt = []string{".js", ".css", ".scss", ".,", ".jpeg", ".jpg", ".png", ".gif", ".svg", ".vue", ".ts", ".swf", ".pdf", ".mp4", ".zip", ".rar"}
	BadURL = []string{";", "}", "\\n", "webpack://", "{", "www.w3.org", ".src", ".url", ".att", ".href", "location.href", "javascript:", "location:", ".createObject", ":location", ".path"}

	ContentTypeMap = map[string]string{
		"application/javascript":   "js",
		"application/json":         "json",
		"application/xml":          "xml",
		"application/octet-stream": "bin",
		"application/atom+xml":     "atom",
		"application/msword":       "doc",
		"application/pdf":          "pdf",
		"image/gif":                "gif",
		"image/jpeg":               "jpg",
		"image/png":                "png",
		"image/svg+xml":            "svg",
		"text/css":                 "css",
		"text/plain":               "txt",
		"text/html":                "html",
		"audio/mpeg":               "mp3",
		"video/mp4":                "mp4",
		"video/ogg":                "ogg",
		"video/webm":               "webm",
		"video/x-ms-wmv":           "wmv",
		"video/avi":                "avi",
		"image/x-icon":             "ico",
	}
)
View Source
var Distance uint8 = 5 // 数字越小越相似, 数字为0则为完全一致.
View Source
var ErrMap = map[ErrorType]string{
	NoErr:                  "",
	ErrBadStatus:           "blacklist status",
	ErrSameStatus:          "same status with random baseline",
	ErrRequestFailed:       "request failed",
	ErrWaf:                 "maybe banned by waf",
	ErrRedirect:            "duplicate redirect url",
	ErrCompareFailed:       "compare failed",
	ErrCustomCompareFailed: "custom compare failed",
	ErrCustomFilter:        "custom filtered",
	ErrFuzzyCompareFailed:  "fuzzy compare failed",
	ErrFuzzyRedirect:       "fuzzy redirect",
	ErrFuzzyNotUnique:      "not unique",
	ErrUrlError:            "url parse error",
	ErrResponseError:       "response parse error",
}
View Source
var MbTable = []uint16{}/* 256 elements not displayed */

Functions

func BakGenerator

func BakGenerator(domain string) []string

func BaseURL

func BaseURL(u *url.URL) string

func CRC16Hash

func CRC16Hash(data []byte) uint16

func CleanURL

func CleanURL(u string) string

func CompareWithExpr

func CompareWithExpr(exp *vm.Program, params map[string]interface{}) bool

func Dir

func Dir(u string) string

func FilterJs

func FilterJs(u string) bool

func FilterUrl

func FilterUrl(u string) bool

func FingerPrintHubDetect added in v0.9.4

func FingerPrintHubDetect(header http.Header, body string) common.Frameworks

func FingersDetect

func FingersDetect(content []byte) common.Frameworks

gogo fingers engine

func FormatURL

func FormatURL(base, u string) string

func Load

func Load() error

func LoadConfig

func LoadConfig(typ string) []byte

func LoadDefaultDict

func LoadDefaultDict() []string

func LoadExtractorConfig

func LoadExtractorConfig(filename string) ([]*parsers.Extractor, error)

func LoadTemplates

func LoadTemplates() error

func MatchWithGlobs

func MatchWithGlobs(u string, globs []string) bool

func ParseRawResponse

func ParseRawResponse(raw []byte) (*http.Response, error)

func RandHost

func RandHost() string

func RandPath

func RandPath() string

func RandomUA

func RandomUA() string

func RelaPath

func RelaPath(base, u string) string

func SafePath

func SafePath(dir, u string) string

func UniqueHash

func UniqueHash(bl *Baseline) uint16

func WappalyzerDetect added in v0.9.5

func WappalyzerDetect(header http.Header, body []byte) common.Frameworks

Types

type BS

type BS []byte

func (BS) String

func (b BS) String() string

type Bar

type Bar struct {
	// contains filtered or unexported fields
}

func NewBar

func NewBar(u string, total int, stat *Statistor, p *mpb.Progress) *Bar

func (*Bar) Close

func (bar *Bar) Close()

func (*Bar) Done

func (bar *Bar) Done()

type Baseline

type Baseline struct {
	*parsers.SprayResult
	Url       *url.URL       `json:"-"`
	Dir       bool           `json:"-"`
	Chunked   bool           `json:"-"`
	Body      BS             `json:"-"`
	Header    BS             `json:"-"`
	Raw       BS             `json:"-"`
	Response  *http.Response `json:"-"`
	Recu      bool           `json:"-"`
	RecuDepth int            `json:"-"`
	URLs      []string       `json:"-"`
	Collected bool           `json:"-"`
	Retry     int            `json:"-"`
}

func NewBaseline

func NewBaseline(u, host string, resp *ihttp.Response) *Baseline

func NewInvalidBaseline

func NewInvalidBaseline(u, host string, resp *ihttp.Response, reason string) *Baseline

func (*Baseline) Collect

func (bl *Baseline) Collect()

Collect 深度收集信息

func (*Baseline) CollectURL

func (bl *Baseline) CollectURL()

func (*Baseline) Compare

func (bl *Baseline) Compare(other *Baseline) int

Compare if totally equal return 1 if maybe equal return 0 not equal return -1

func (*Baseline) FuzzyCompare

func (bl *Baseline) FuzzyCompare(other *Baseline) bool

func (*Baseline) IsDir

func (bl *Baseline) IsDir() bool

type ErrorType

type ErrorType uint
const (
	NoErr ErrorType = iota
	ErrBadStatus
	ErrSameStatus
	ErrRequestFailed
	ErrWaf
	ErrRedirect
	ErrCompareFailed
	ErrCustomCompareFailed
	ErrCustomFilter
	ErrFuzzyCompareFailed
	ErrFuzzyRedirect
	ErrFuzzyNotUnique
	ErrUrlError
	ErrResponseError
)

func (ErrorType) Error

func (e ErrorType) Error() string

type Statistor

type Statistor struct {
	BaseUrl        string                      `json:"url"`
	Error          string                      `json:"error"`
	Counts         map[int]int                 `json:"counts"`
	Sources        map[parsers.SpraySource]int `json:"sources"`
	FailedNumber   int32                       `json:"failed"`
	ReqTotal       int32                       `json:"req_total"`
	CheckNumber    int                         `json:"check"`
	FoundNumber    int                         `json:"found"`
	FilteredNumber int                         `json:"filtered"`
	FuzzyNumber    int                         `json:"fuzzy"`
	WafedNumber    int                         `json:"wafed"`
	End            int                         `json:"end"`
	Skipped        int                         `json:"skipped"`
	Offset         int                         `json:"offset"`
	Total          int                         `json:"total"`
	StartTime      int64                       `json:"start_time"`
	EndTime        int64                       `json:"end_time"`
	WordCount      int                         `json:"word_count"`
	Word           string                      `json:"word"`
	Dictionaries   []string                    `json:"dictionaries"`
	RuleFiles      []string                    `json:"rule_files"`
	RuleFilter     string                      `json:"rule_filter"`
}
var DefaultStatistor Statistor

func NewStatistor

func NewStatistor(url string) *Statistor

func NewStatistorFromStat

func NewStatistorFromStat(origin *Statistor) *Statistor

func (*Statistor) ColorCountString

func (stat *Statistor) ColorCountString() string

func (*Statistor) ColorSourceString

func (stat *Statistor) ColorSourceString() string

func (*Statistor) ColorString

func (stat *Statistor) ColorString() string

func (*Statistor) CountString

func (stat *Statistor) CountString() string

func (*Statistor) Json

func (stat *Statistor) Json() string

func (*Statistor) SourceString

func (stat *Statistor) SourceString() string

func (*Statistor) String

func (stat *Statistor) String() string

type Statistors

type Statistors []*Statistor

func ReadStatistors

func ReadStatistors(filename string) (Statistors, error)

Jump to

Keyboard shortcuts

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