Skip to content

Commit

Permalink
Adds CPE field; switches to community fork for fingerprint data (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnomnom authored Feb 20, 2024
1 parent d28bd43 commit 882b675
Show file tree
Hide file tree
Showing 4 changed files with 587 additions and 290 deletions.
5 changes: 4 additions & 1 deletion cmd/update-fingerprints/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Fingerprint struct {
Implies interface{} `json:"implies"`
Description string `json:"description"`
Website string `json:"website"`
CPE string `json:"cpe"`
}

// OutputFingerprints contains a map of fingerprints for tech detection
Expand All @@ -59,9 +60,10 @@ type OutputFingerprint struct {
Implies []string `json:"implies,omitempty"`
Description string `json:"description,omitempty"`
Website string `json:"website,omitempty"`
CPE string `json:"cpe,omitempty"`
}

const fingerprintURL = "https://raw.githubusercontent.com/AliasIO/wappalyzer/master/src/technologies/%s.json"
const fingerprintURL = "https://raw.githubusercontent.com/Lissy93/wapalyzer/master/src/technologies/%s.json"

func makeFingerprintURLs() []string {
files := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "_"}
Expand Down Expand Up @@ -155,6 +157,7 @@ func normalizeFingerprints(fingerprints *Fingerprints) *OutputFingerprints {
Meta: make(map[string][]string),
Description: fingerprint.Description,
Website: fingerprint.Website,
CPE: fingerprint.CPE,
}

for cookie, value := range fingerprint.Cookies {
Expand Down
5 changes: 5 additions & 0 deletions fingerprints.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Fingerprint struct {
Implies []string `json:"implies"`
Description string `json:"description"`
Website string `json:"website"`
CPE string `json:"cpe"`
}

// CompiledFingerprints contains a map of fingerprints for tech detection
Expand Down Expand Up @@ -59,12 +60,15 @@ type CompiledFingerprint struct {
scriptSrc []*versionRegex
// meta contains fingerprints for meta tags
meta map[string][]*versionRegex
// cpe contains the cpe for a fingerpritn
cpe string
}

// AppInfo contains basic information about an App.
type AppInfo struct {
Description string
Website string
CPE string
}

// CatsInfo contains basic information about an App.
Expand Down Expand Up @@ -152,6 +156,7 @@ func compileFingerprint(fingerprint *Fingerprint) *CompiledFingerprint {
script: make([]*versionRegex, 0, len(fingerprint.Script)),
scriptSrc: make([]*versionRegex, 0, len(fingerprint.ScriptSrc)),
meta: make(map[string][]*versionRegex),
cpe: fingerprint.CPE,
}

for header, pattern := range fingerprint.Cookies {
Expand Down
Loading

0 comments on commit 882b675

Please sign in to comment.