fingerprint

package
v0.0.0-...-7ef1397 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxWidth    = 1280 //1980
	MinHeight   = 800  //1080
	SavedWidth  = 1280 //1024
	SavedHeight = 800  //768

)

Variables

View Source
var HttpxOutputDirectory string //全局的httpx保存响应的数据,用于自定义指纹匹配
View Source
var IgnorePort = []int{7, 9, 13, 17, 19, 21, 22, 23, 25, 26, 37, 53, 100, 106, 110, 111, 113, 119, 135, 138, 139,
	143, 144, 145, 161,
	179, 199, 389, 427, 444, 445, 514, 515, 543, 554, 631, 636, 646, 880, 902, 990, 993,
	1433, 1521, 3306, 5432, 3389, 5900, 5901, 5902, 49152, 49153, 49154, 49155, 49156, 49157,
	49158, 49159, 49160, 49161, 49163, 49165, 49167, 49175, 49176,
	13306, 11521, 15432, 11433, 13389, 15900, 15901}

Functions

func CheckForHttpxFingerResult

func CheckForHttpxFingerResult(ip string, domain string, port int, resultPortscan *portscan.Result, resultDomainScan *domainscan.Result) bool

func DoFullScreenshot

func DoFullScreenshot(url, path string) bool

DoFullScreenshot 调用chromedp执行截图

func SplitChar76

func SplitChar76(braw []byte) []byte

SplitChar76 按照 76 字符切分

Types

type CustomFingerPrint

type CustomFingerPrint struct {
	Id      int     `json:"id"`
	App     string  `json:"app"`
	Rule    string  `json:"rule"`
	Company *string `json:"company,omitempty"`
	RuleId  *int    `json:"rule_id,omitempty"`
}

CustomFingerPrint 自定义指纹结构

type FingerAttrResult

type FingerAttrResult struct {
	Tag     string
	Content string
}

type FingerprintHub

type FingerprintHub struct {
	ResultPortScan   *portscan.Result
	ResultDomainScan *domainscan.Result
	DomainTargetPort map[string]map[int]struct{}
	OptimizationMode bool
}

func NewFingerprintHub

func NewFingerprintHub() *FingerprintHub

NewFingerprintHub NNewFingerprintHub 创建FingerprintHub对象

func (*FingerprintHub) Do

func (f *FingerprintHub) Do()

Do 调用ObserverWard,获取指纹

func (*FingerprintHub) RunObserverWard

func (f *FingerprintHub) RunObserverWard(url string) []FingerprintHubReult

RunObserverWard 调用ObserverWard,获取一个目标的指纹

type FingerprintHubReult

type FingerprintHubReult struct {
	Url        string   `json:"url"`
	Name       []string `json:"name"`
	Priority   int      `json:"priority"`
	Length     int      `json:"length"`
	Title      string   `json:"title"`
	StatusCode int      `json:"status_code"`
	Plugins    []string `json:"plugins"`
}

type Fingerprintx

type Fingerprintx struct {
	ResultPortScan   *portscan.Result
	OptimizationMode bool
	IsProxy          bool
}

func NewFingerprintx

func NewFingerprintx() *Fingerprintx

func (*Fingerprintx) Do

func (f *Fingerprintx) Do()

func (*Fingerprintx) RunFingerprintx

func (f *Fingerprintx) RunFingerprintx(domain string) (result []FingerAttrResult)

type FingerprintxService

type FingerprintxService struct {
	Host      string          `json:"host,omitempty"`
	IP        string          `json:"ip"`
	Port      int             `json:"port"`
	Protocol  string          `json:"protocol"`
	TLS       bool            `json:"tls"`
	Transport string          `json:"transport"`
	Version   string          `json:"version,omitempty"`
	Raw       json.RawMessage `json:"metadata"`
}

type HttpxAll

type HttpxAll struct {
	IsFingerprintHub    bool
	IsScreenshot        bool
	IsIconHash          bool
	IsCustomFingerprint bool

	ResultPortScan     *portscan.Result
	ResultDomainScan   *domainscan.Result
	DomainTargetPort   map[string]map[int]struct{}
	ResultScreenShot   *ScreenshotResult
	ResultIconHashInfo *IconHashInfoResult
	FingerPrintFunc    []func(domain string, ip string, port int, url string, result []FingerAttrResult, storedResponsePathFile string) []string

	IsProxy bool
	// contains filtered or unexported fields
}

func NewHttpxAll

func NewHttpxAll() *HttpxAll

NewHttpxAll 创建对象

func (*HttpxAll) Do

func (x *HttpxAll) Do()

func (*HttpxAll) ParseContentResult

func (x *HttpxAll) ParseContentResult(content []byte) (result portscan.Result)

ParseContentResult 解析httpx扫描的JSON格式文件结果

func (*HttpxAll) ParseHttpxJson

func (x *HttpxAll) ParseHttpxJson(content []byte) (host string, port int, result []FingerAttrResult, urlResponse, storedResponsePathFile, storedFaviconPathFile, storedScreenshotPathFile string)

ParseHttpxJson 解析一条httpx的JSON记录

func (*HttpxAll) RunHttpx

func (x *HttpxAll) RunHttpx(domain string) (result []FingerAttrResult, urlResponse, storedResponsePathFile, storedFaviconPathFile, storedScreenshotPathFile string)

RunHttpx 调用httpx,获取一个domain的标题指纹

type HttpxResult

type HttpxResult struct {
	A                  []string `json:"a,omitempty"`
	CNames             []string `json:"cnames,omitempty"`
	Scheme             string   `json:"scheme,omitempty"`
	Url                string   `json:"url,omitempty"`
	Host               string   `json:"host,omitempty"`
	Port               string   `json:"port,omitempty"`
	Title              string   `json:"title,omitempty"`
	WebServer          string   `json:"webserver,omitempty"`
	ContentType        string   `json:"content_type,omitempty"`
	StatusCode         int      `json:"status_code,omitempty"`
	TLSData            *TLS     `json:"tls,omitempty"`
	Jarm               string   `json:"jarm,omitempty"`
	StoredResponsePath string   `json:"stored_response_path,omitempty"`
	IconHash           string   `json:"favicon,omitempty"`
	FaviconPath        string   `json:"favicon_path,omitempty"`
	ScreenShotPath     string   `json:"screenshot_path,omitempty"`
}

type IconHash

type IconHash struct {
	ResultPortScan     *portscan.Result
	ResultDomainScan   *domainscan.Result
	IconHashInfoResult *IconHashInfoResult
	DomainTargetPort   map[string]map[int]struct{}
	OptimizationMode   bool
}

func NewIconHash

func NewIconHash() *IconHash

func (*IconHash) Do

func (i *IconHash) Do()

func (*IconHash) RunFetchIconHashes

func (i *IconHash) RunFetchIconHashes(url string) (hashResult []IconHashResult)

func (*IconHash) SaveFile

func (i *IconHash) SaveFile(localSavePath string, result []IconHashInfo) string

SaveFile 保存icon Image文件

type IconHashInfo

type IconHashInfo struct {
	Url       string
	Hash      string
	ImageData []byte
}

type IconHashInfoResult

type IconHashInfoResult struct {
	sync.RWMutex
	Result []IconHashInfo
}

type IconHashResult

type IconHashResult struct {
	Url       string
	Hash      string
	ImageData []byte
}

type ScreenShot

type ScreenShot struct {
	ResultPortScan   *portscan.Result
	ResultDomainScan *domainscan.Result
	ResultScreenShot ScreenshotResult
	DomainTargetPort map[string]map[int]struct{}
	OptimizationMode bool
}

func NewScreenShot

func NewScreenShot() *ScreenShot

NewScreenShot 创建ScreenShot对象

func (*ScreenShot) Delete

func (s *ScreenShot) Delete(workspaceGUID, domain string) bool

Delete 删除指定domain、IP下保存的screenshot文件

func (*ScreenShot) Do

func (s *ScreenShot) Do()

Do 执行任务

func (*ScreenShot) LoadResult

func (s *ScreenShot) LoadResult() (result []ScreenshotFileInfo)

LoadResult 获取screenshot的结果文件

func (*ScreenShot) LoadScreenshotFile

func (s *ScreenShot) LoadScreenshotFile(workspaceGUID, domain string) (r []string)

LoadScreenshotFile 获取screenshot文件

func (*ScreenShot) SaveFile

func (s *ScreenShot) SaveFile(localSavePath string, result []ScreenshotFileInfo) (count int)

SaveFile 保存screenshot文件到本地

type ScreenshotFileInfo

type ScreenshotFileInfo struct {
	Domain   string `json:"domain"`
	Port     int    `json:"port"`
	Protocol string `json:"protocol"`
	Content  []byte `json:"content"`
}

type ScreenshotInfo

type ScreenshotInfo struct {
	Port         int
	Protocol     string
	FilePathName string
}

type ScreenshotResult

type ScreenshotResult struct {
	sync.RWMutex
	Result map[string][]ScreenshotInfo
}

func (*ScreenshotResult) HasDomain

func (r *ScreenshotResult) HasDomain(domain string) bool

func (*ScreenshotResult) SetDomain

func (r *ScreenshotResult) SetDomain(domain string)

func (*ScreenshotResult) SetScreenshotInfo

func (r *ScreenshotResult) SetScreenshotInfo(domain string, si ScreenshotInfo)

type TLS

type TLS struct {
	SubjectDNSName           []string `json:"subject_an,omitempty"`
	SubjectCommonName        string   `json:"subject_cn,omitempty"`
	SubjectDistinguishedName string   `json:"subject_dn,omitempty"`
	SubjectOrganization      []string `json:"subject_org,omitempty"`
	IssuerDistinguishedName  string   `json:"issuer_dn,omitempty"`
	IssuerOrganization       []string `json:"issuer_org,omitempty"`
}

type WebFingerPrint

type WebFingerPrint struct {
	Name           string            `json:"name"`
	Path           string            `json:"path"`
	RequestMethod  string            `json:"request_method"`
	RequestHeaders map[string]string `json:"request_headers"`
	RequestData    string            `json:"request_data"`
	StatusCode     int               `json:"status_code"`
	Headers        map[string]string `json:"headers"`
	Keyword        []string          `json:"keyword"`
	FaviconHash    []string          `json:"favicon_hash"`
	Priority       int               `json:"priority"`
}

WebFingerPrint 匹配web_fingerprint_v3.json的指纹结构 通过借鉴afrog代码获取fingerprinthub定义的指纹信息

Jump to

Keyboard shortcuts

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