Documentation
ΒΆ
Index ΒΆ
- Constants
- func ComputeFaviconHash(data []byte) int32
- func ComputeFaviconMD5(data []byte) string
- func ShouldRunBrowserDetection(techName string, results map[string]*Technology, probe BrowserProbe) bool
- type BatchResults
- type BrowserDetector
- type BrowserPathClassification
- type BrowserProbe
- type DetectResult
- type DetectionContext
- type Detector
- type Fingerprint
- type FingerprintDB
- type HTTPDetector
- type Loader
- type PathClassification
- type PathProbe
- type QueryEvaluator
- type RequestConfig
- type ScanResult
- type Technology
Constants ΒΆ
const ( MaxRetries = 1 RequestTimeout = 10 * time.Second MaxRedirects = 3 InitialBackoff = 1 * time.Second )
Variables ΒΆ
This section is empty.
Functions ΒΆ
func ComputeFaviconHash ΒΆ added in v1.0.2
ComputeFaviconHash returns the Shodan-compatible MurmurHash3 x86/32 of a favicon: standard base64 with a newline every 76 characters and a trailing newline, then signed mmh3 (seed 0).
func ComputeFaviconMD5 ΒΆ added in v1.0.2
ComputeFaviconMD5 returns the hex MD5 of raw favicon bytes (OWASP/WhatWeb style).
func ShouldRunBrowserDetection ΒΆ
func ShouldRunBrowserDetection(techName string, results map[string]*Technology, probe BrowserProbe) bool
ShouldRunBrowserDetection determines if browser detection should run for a technology
Types ΒΆ
type BatchResults ΒΆ
type BatchResults struct {
Results []ScanResult `json:"results"`
}
BatchResults wraps multiple scan results for JSON array output
type BrowserDetector ΒΆ
type BrowserDetector struct {
// contains filtered or unexported fields
}
BrowserDetector performs browser-based detection
func NewBrowserDetector ΒΆ
func NewBrowserDetector() *BrowserDetector
NewBrowserDetector creates a new browser detector
func NewBrowserDetectorWithOptions ΒΆ
func NewBrowserDetectorWithOptions(proxyURL string) *BrowserDetector
NewBrowserDetectorWithOptions creates a new browser detector with proxy support
func (*BrowserDetector) DetectBrowser ΒΆ
func (bd *BrowserDetector) DetectBrowser(baseURL string, fingerprints map[string]Fingerprint, httpResults map[string]*Technology) (map[string]*Technology, error)
DetectBrowser performs browser-based detection
type BrowserPathClassification ΒΆ
type BrowserPathClassification struct {
Path string
Technologies map[string][]BrowserProbe // tech name -> probes
}
BrowserPathClassification groups browser probes by path
func ClassifyBrowserByPath ΒΆ
func ClassifyBrowserByPath(fingerprints map[string]Fingerprint) []BrowserPathClassification
ClassifyBrowserByPath groups browser fingerprints by path
type BrowserProbe ΒΆ
type BrowserProbe struct {
Path string `json:"path"`
Detection string `json:"detection,omitempty"`
Version string `json:"version,omitempty"`
}
BrowserProbe represents a browser-based detection probe
func (*BrowserProbe) HasDetectionCapability ΒΆ
func (bp *BrowserProbe) HasDetectionCapability() bool
HasDetectionCapability checks if browser probe can detect technology
func (*BrowserProbe) HasVersionCapability ΒΆ
func (bp *BrowserProbe) HasVersionCapability() bool
HasVersionCapability checks if browser probe can extract version
type DetectResult ΒΆ
type DetectResult struct {
Technologies []Technology `json:"technologies"`
FailedPaths []string `json:"failed_paths,omitempty"`
}
DetectResult contains detection results
type DetectionContext ΒΆ
DetectionContext holds data available for detection
type Detector ΒΆ
type Detector struct {
// contains filtered or unexported fields
}
Detector is the main detection engine
func NewDetector ΒΆ
NewDetector creates a new detection engine
func NewDetectorWithOptions ΒΆ
func NewDetectorWithOptions(fingerprintsDir string, insecureSkipVerify bool, proxyURL string) (*Detector, error)
NewDetectorWithOptions creates a new detection engine with custom options
func (*Detector) Detect ΒΆ
func (d *Detector) Detect(url string, useBrowser bool) (*DetectResult, error)
Detect performs full detection (HTTP + Browser) on a target URL
func (*Detector) DetectFull ΒΆ
func (d *Detector) DetectFull(url string) (*DetectResult, error)
DetectFull performs full detection including browser stage
func (*Detector) DetectHTTPOnly ΒΆ
func (d *Detector) DetectHTTPOnly(url string) (*DetectResult, error)
DetectHTTPOnly performs HTTP-only detection (fast, no browser)
type Fingerprint ΒΆ
type Fingerprint struct {
Cats []int `json:"cats"`
Implies []string `json:"implies,omitempty"`
FaviconHashes []int32 `json:"favicon_hashes,omitempty"`
FaviconMD5 []string `json:"favicon_md5,omitempty"`
Paths []PathProbe `json:"paths,omitempty"`
Browser []BrowserProbe `json:"browser,omitempty"`
Description string `json:"description,omitempty"`
Website string `json:"website,omitempty"`
Icon string `json:"icon,omitempty"`
CPE string `json:"cpe,omitempty"`
}
Fingerprint represents the detection rules for a technology
type FingerprintDB ΒΆ
type FingerprintDB struct {
Apps map[string]Fingerprint `json:"apps"`
}
FingerprintDB represents the entire fingerprint database
type HTTPDetector ΒΆ
type HTTPDetector struct {
// contains filtered or unexported fields
}
HTTPDetector performs HTTP-based detection
func NewHTTPDetector ΒΆ
func NewHTTPDetector() *HTTPDetector
NewHTTPDetector creates a new HTTP detector
func NewHTTPDetectorWithOptions ΒΆ
func NewHTTPDetectorWithOptions(insecureSkipVerify bool, proxyURL string) *HTTPDetector
NewHTTPDetectorWithOptions creates a new HTTP detector with custom options
func (*HTTPDetector) DetectHTTP ΒΆ
func (hd *HTTPDetector) DetectHTTP(baseURL string, fingerprints map[string]Fingerprint) (map[string]*Technology, []string)
DetectHTTP performs HTTP-based detection on a target URL
type Loader ΒΆ
type Loader struct {
// contains filtered or unexported fields
}
Loader handles loading fingerprints from disk or embedded FS
type PathClassification ΒΆ
type PathClassification struct {
Path string
RequestConf *RequestConfig
Technologies map[string][]PathProbe // tech name -> probes
}
PathClassification groups fingerprints by path
func ClassifyByPath ΒΆ
func ClassifyByPath(fingerprints map[string]Fingerprint) []PathClassification
ClassifyByPath groups all fingerprints by their request paths
type PathProbe ΒΆ
type PathProbe struct {
Path string `json:"path"`
Request *RequestConfig `json:"request,omitempty"`
Detect map[string]interface{} `json:"detect"`
ExtractVersion []map[string]string `json:"extract_version,omitempty"`
}
PathProbe represents an HTTP-based detection probe
type QueryEvaluator ΒΆ
type QueryEvaluator struct{}
QueryEvaluator evaluates MongoDB-style queries against a context
func NewQueryEvaluator ΒΆ
func NewQueryEvaluator() *QueryEvaluator
NewQueryEvaluator creates a new query evaluator
func (*QueryEvaluator) Evaluate ΒΆ
func (qe *QueryEvaluator) Evaluate(query map[string]interface{}, ctx *DetectionContext) (bool, string)
Evaluate evaluates a query against the detection context
func (*QueryEvaluator) ExtractVersion ΒΆ
func (qe *QueryEvaluator) ExtractVersion(rules []map[string]string, ctx *DetectionContext) string
ExtractVersion attempts to extract version from context using extraction rules
type RequestConfig ΒΆ
type RequestConfig struct {
Method string `json:"method,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Body interface{} `json:"body,omitempty"`
}
RequestConfig represents optional HTTP request configuration
type ScanResult ΒΆ
type ScanResult struct {
URL string `json:"url"`
Technologies map[string]string `json:"technologies"` // tech name -> version
Mode string `json:"mode"` // "http", "browser", or "hybrid"
Error string `json:"error,omitempty"` // error message if scan failed
}
ScanResult represents the result for a single URL in JSON/JSONL format
type Technology ΒΆ
Technology represents a detected technology