wappalyzer

package module
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 15 Imported by: 130

README

Wappalyzergo

A high performance port of the Wappalyzer Technology Detection Library to Go. Inspired by Webanalyze.

Uses data from

Features

  • Very simple and easy to use, with clean codebase.
  • Normalized regexes + auto-updating database of wappalyzer fingerprints.
  • Optimized for performance: parsing HTML manually for best speed.
Using go install
go install -v github.com/projectdiscovery/wappalyzergo/cmd/update-fingerprints@latest

After this command wappalyzergo library source will be in your current go.mod.

Example

Usage Example:

package main

import (
	"fmt"
	"io"
	"log"
	"net/http"

	wappalyzer "github.com/projectdiscovery/wappalyzergo"
)

func main() {
	resp, err := http.DefaultClient.Get("https://www.hackerone.com")
	if err != nil {
		log.Fatal(err)
	}
	data, _ := io.ReadAll(resp.Body) // Ignoring error for example

	wappalyzerClient, err := wappalyzer.New()
	fingerprints := wappalyzerClient.Fingerprint(resp.Header, data)
	fmt.Printf("%v\n", fingerprints)

	// Output: map[Acquia Cloud Platform:{} Amazon EC2:{} Apache:{} Cloudflare:{} Drupal:{} PHP:{} Percona:{} React:{} Varnish:{}]
}
Optional runtime detection

Fingerprint still uses only the response headers and body. Use FingerprintWithRuntime to also check JavaScript properties, the rendered DOM, and script content. The optional headless adapter works with a Rod page that the caller has already loaded. The caller remains responsible for launching, navigating, and closing the browser.

collector := headless.New(page)

fingerprints, err := wappalyzerClient.FingerprintWithRuntime(
	ctx, resp.Header, data,
	wappalyzer.RuntimeOptions{
		Collector: collector,
		Timeout:   10 * time.Second,
	},
)

If runtime collection returns an error, the result still includes passive matches and any matches found before the failure. Other browser integrations can implement wappalyzer.RuntimeCollector without importing the Rod adapter.

Documentation

Index

Constants

View Source
const DefaultRuntimeTimeout = 10 * time.Second

DefaultRuntimeTimeout is the maximum runtime evidence collection time used when RuntimeOptions.Timeout is zero.

Variables

This section is empty.

Functions

func FormatAppVersion added in v0.1.5

func FormatAppVersion(app, version string) string

func GetCategoriesMapping added in v0.1.7

func GetCategoriesMapping() map[int]categoryItem

func GetFingerprints added in v0.0.40

func GetFingerprints() string

GetFingerprints returns the fingerprint string from wappalyzer

func GetRawFingerprints added in v0.1.7

func GetRawFingerprints() string

Types

type AppInfo added in v0.0.78

type AppInfo struct {
	Description string
	Website     string
	CPE         string
	Icon        string
	Categories  []string
}

AppInfo contains basic information about an App.

func AppInfoFromFingerprint added in v0.1.5

func AppInfoFromFingerprint(fingerprint *CompiledFingerprint) AppInfo

type CatsInfo added in v0.0.110

type CatsInfo struct {
	Cats []int
}

CatsInfo contains basic information about an App.

type CompiledFingerprint

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

CompiledFingerprint contains the compiled fingerprints from the tech json

func (*CompiledFingerprint) GetDOMRules added in v0.1.5

func (f *CompiledFingerprint) GetDOMRules() map[string]map[string]*ParsedPattern

func (*CompiledFingerprint) GetJSRules added in v0.1.5

func (f *CompiledFingerprint) GetJSRules() map[string]*ParsedPattern

type CompiledFingerprints

type CompiledFingerprints struct {
	// Apps is organized as <name, fingerprint>
	Apps map[string]*CompiledFingerprint
	// contains filtered or unexported fields
}

CompiledFingerprints contains a map of fingerprints for tech detection

type Fingerprint

type Fingerprint struct {
	Cats        []int                             `json:"cats"`
	CSS         []string                          `json:"css"`
	Cookies     map[string]string                 `json:"cookies"`
	Dom         map[string]map[string]interface{} `json:"dom"`
	JS          map[string]string                 `json:"js"`
	Headers     map[string]string                 `json:"headers"`
	HTML        []string                          `json:"html"`
	Script      []string                          `json:"scripts"`
	ScriptSrc   []string                          `json:"scriptSrc"`
	Meta        map[string][]string               `json:"meta"`
	Implies     []string                          `json:"implies"`
	Description string                            `json:"description"`
	Website     string                            `json:"website"`
	CPE         string                            `json:"cpe"`
	Icon        string                            `json:"icon"`
}

Fingerprint is a single piece of information about a tech validated and normalized

type Fingerprints

type Fingerprints struct {
	// Apps is organized as <name, fingerprint>
	Apps map[string]*Fingerprint `json:"apps"`
}

Fingerprints contains a map of fingerprints for tech detection

type ParsedPattern added in v0.1.7

type ParsedPattern struct {
	Confidence int
	Version    string
	SkipRegex  bool
	// contains filtered or unexported fields
}

ParsedPattern encapsulates a regular expression with additional metadata for confidence and version extraction.

func ParsePattern added in v0.1.7

func ParsePattern(pattern string) (*ParsedPattern, error)

ParsePattern extracts information from a pattern, supporting both regex and simple patterns

func (*ParsedPattern) Evaluate added in v0.1.7

func (p *ParsedPattern) Evaluate(target string) (bool, string)

type RuntimeCollector added in v0.3.0

type RuntimeCollector interface {
	Collect(ctx context.Context, rules RuntimeRules) (RuntimeEvidence, error)
}

RuntimeCollector collects browser runtime evidence for a complete rule set. Collect must process the rule set as one batch and stop when ctx is done.

type RuntimeDOMEvidence added in v0.3.0

type RuntimeDOMEvidence struct {
	Exists bool     `json:"exists,omitempty"`
	Text   []string `json:"text,omitempty"`
	// Attributes includes a value only when the node has the attribute.
	Attributes map[string][]string `json:"attributes,omitempty"`
	// Properties includes a value only when the node has the own property.
	Properties map[string][]string `json:"properties,omitempty"`
}

RuntimeDOMEvidence contains rendered values for one DOM selector.

type RuntimeDOMRule added in v0.3.0

type RuntimeDOMRule struct {
	Selector string `json:"selector"`
	Exists   bool   `json:"exists,omitempty"`
	Text     bool   `json:"text,omitempty"`
	// Attributes and Properties contain names, not executable expressions.
	Attributes []string `json:"attributes,omitempty"`
	Properties []string `json:"properties,omitempty"`
}

RuntimeDOMRule describes the evidence required for one DOM selector.

type RuntimeEvidence added in v0.3.0

type RuntimeEvidence struct {
	// JavaScriptProperties maps each observed chain to its scalar string value.
	// Strings and numbers keep their text; other defined values use their truth value.
	JavaScriptProperties map[string]string `json:"javascriptProperties,omitempty"`
	// DOM is keyed by the exact selector from [RuntimeRules.DOM].
	DOM map[string]RuntimeDOMEvidence `json:"dom,omitempty"`
	// Scripts contains script response or inline source text.
	Scripts []string `json:"scripts,omitempty"`
}

RuntimeEvidence contains values observed from a rendered page. Map presence means that a JavaScript property exists. Text entries must be non-empty.

type RuntimeOptions added in v0.3.0

type RuntimeOptions struct {
	// Collector reads the caller-owned runtime environment.
	Collector RuntimeCollector
	// Timeout bounds collection. Zero uses [DefaultRuntimeTimeout].
	Timeout time.Duration
}

RuntimeOptions configures optional runtime fingerprinting.

type RuntimeRules added in v0.3.0

type RuntimeRules struct {
	// JavaScriptProperties contains dot-separated, own-property chains rooted at window.
	JavaScriptProperties []string `json:"javascriptProperties,omitempty"`
	// DOM contains the rendered selectors and values that must be collected.
	DOM []RuntimeDOMRule `json:"dom,omitempty"`
	// Scripts requests inline and loaded external script content.
	Scripts bool `json:"scripts,omitempty"`
}

RuntimeRules describes the browser state that a RuntimeCollector must inspect. The rule strings are data and must not be evaluated as source code.

type UniqueFingerprints added in v0.1.5

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

func NewUniqueFingerprints added in v0.1.5

func NewUniqueFingerprints() UniqueFingerprints

func (UniqueFingerprints) GetValues added in v0.1.5

func (u UniqueFingerprints) GetValues() map[string]struct{}

func (UniqueFingerprints) SetIfNotExists added in v0.1.5

func (u UniqueFingerprints) SetIfNotExists(value, version string, confidence int)

type Wappalyze

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

Wappalyze is a client for working with tech detection

func New

func New() (*Wappalyze, error)

New creates a new tech detection instance

func NewFromFile added in v0.2.29

func NewFromFile(filePath string, loadEmbedded, supersede bool) (*Wappalyze, error)

NewFromFile creates a new tech detection instance from a file this allows using the latest fingerprints without recompiling the code loadEmbedded indicates whether to load the embedded fingerprints supersede indicates whether to overwrite the embedded fingerprints (if loaded) with the file fingerprints if the app name conflicts supersede is only used if loadEmbedded is true

func (*Wappalyze) Fingerprint

func (s *Wappalyze) Fingerprint(headers map[string][]string, body []byte) map[string]struct{}

Fingerprint identifies technologies on a target, based on the received response headers and body.

Body should not be mutated while this function is being called, or it may lead to unexpected things.

func (*Wappalyze) FingerprintWithCats added in v0.0.110

func (s *Wappalyze) FingerprintWithCats(headers map[string][]string, body []byte) map[string]CatsInfo

FingerprintWithCats identifies technologies on a target, based on the received response headers and body. It also returns categories information about the technology, is there's any Body should not be mutated while this function is being called, or it may lead to unexpected things.

func (*Wappalyze) FingerprintWithInfo added in v0.0.78

func (s *Wappalyze) FingerprintWithInfo(headers map[string][]string, body []byte) map[string]AppInfo

FingerprintWithInfo identifies technologies on a target, based on the received response headers and body. It also returns basic information about the technology, such as description and website URL as well as icon.

Body should not be mutated while this function is being called, or it may lead to unexpected things.

func (*Wappalyze) FingerprintWithRuntime added in v0.3.0

func (s *Wappalyze) FingerprintWithRuntime(
	ctx context.Context,
	headers map[string][]string,
	body []byte,
	options RuntimeOptions,
) (map[string]struct{}, error)

FingerprintWithRuntime identifies technologies from passive response data and from one batch of browser runtime evidence. The returned map includes usable passive and partial runtime matches when collection returns an error.

func (*Wappalyze) FingerprintWithTitle

func (s *Wappalyze) FingerprintWithTitle(headers map[string][]string, body []byte) (map[string]struct{}, string)

FingerprintWithTitle identifies technologies on a target, based on the received response headers and body. It also returns the title of the page.

Body should not be mutated while this function is being called, or it may lead to unexpected things.

func (*Wappalyze) GetCompiledFingerprints added in v0.1.5

func (s *Wappalyze) GetCompiledFingerprints() *CompiledFingerprints

GetCompiledFingerprints returns the compiled fingerprints

func (*Wappalyze) GetFingerprints added in v0.1.5

func (s *Wappalyze) GetFingerprints() *Fingerprints

GetFingerprints returns the original fingerprints

func (*Wappalyze) RuntimeRules added in v0.3.0

func (s *Wappalyze) RuntimeRules() RuntimeRules

RuntimeRules returns an isolated, deterministic copy of the runtime rule set. Callers can use it to implement a custom RuntimeCollector.

Directories

Path Synopsis
cmd
Package headless adapts a caller-owned Rod page to wappalyzer runtime evidence collection.
Package headless adapts a caller-owned Rod page to wappalyzer runtime evidence collection.

Jump to

Keyboard shortcuts

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