diff --git a/package.json b/package.json index 0bbd562e2..11b8fbaff 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ }, "scripts": { "link": "node ./bin/link.js", - "validate": "jsonlint -qV ./schema.json ./src/apps.json && node ./bin/validate.js", + "lint": "eslint src/**/*.js", + "validate": "yarn run lint && jsonlint -qV ./schema.json ./src/apps.json && node ./bin/validate.js", "convert": "cd ./src/drivers/webextension/images/icons ; cp *.svg converted ; cd converted ; convert-svg-to-png *.svg --width 32 --height 32 ; rm *.svg", "prettify": "jsonlint -si --trim-trailing-commas --enforce-double-quotes ./src/apps.json", "build": "yarn run link && yarn run validate && yarn run prettify && yarn run convert && node ./bin/build.js" diff --git a/src/apps.json b/src/apps.json index cc18ffbc7..4329e1a55 100644 --- a/src/apps.json +++ b/src/apps.json @@ -1732,7 +1732,6 @@ "cats": [ 2 ], - "html": "]+woltlab\\.com[^<]+Burning Board", "icon": "Burning Board.png", "implies": [ "PHP", @@ -2530,7 +2529,6 @@ "Server": "^Cowboy$" }, "icon": "Cowboy.png", - "implies": "Erlang", "website": "http://ninenines.eu" }, "CppCMS": { @@ -12494,7 +12492,6 @@ "cats": [ 1 ], - "html": "var WCF_PATH[^>]+", "icon": "Woltlab Community Framework.png", "implies": "PHP", "script": "WCF\\..*\\.js", @@ -12879,7 +12876,6 @@ "Server": "Yaws(?: ([\\d.]+))?\\;version:\\1" }, "icon": "Yaws.png", - "implies": "Erlang", "website": "http://yaws.hyber.org" }, "Yepcomm": { diff --git a/src/drivers/bookmarklet/driver.js b/src/drivers/bookmarklet/driver.js index 1b1503d96..a59699358 100644 --- a/src/drivers/bookmarklet/driver.js +++ b/src/drivers/bookmarklet/driver.js @@ -1,9 +1,5 @@ -/** - * Bookmarklet driver - */ - -/** global: wappalyzer */ -/** global: XMLHttpRequest */ +/* eslint-env browser */ +/* globals wappalyzer */ ;(function() { wappalyzer.driver.document = document @@ -16,6 +12,7 @@ * Log messages to console */ wappalyzer.driver.log = (message, source, type) => { + // eslint-disable-next-line no-console console.log(`[wappalyzer ${type}]`, `[${source}]`, message) } @@ -54,7 +51,7 @@ if (xhr.readyState === 4 && xhr.status) { const headers = xhr.getAllResponseHeaders().split('\n') - if (headers.length > 0 && headers[0] != '') { + if (headers.length > 0 && headers[0] !== '') { wappalyzer.log( `responseHeaders: ${xhr.getAllResponseHeaders()}`, 'driver' @@ -89,7 +86,7 @@ /** * Display apps */ - ;(wappalyzer.driver.displayApps = (detected) => { + wappalyzer.driver.displayApps = (detected) => { wappalyzer.log('func: displayApps', 'driver') let first = true @@ -150,13 +147,14 @@ html += '' container.innerHTML = html - }), - /** - * Open a tab - */ - function openTab(args) { - open(args.url) - } + } + + /** + * Open a tab + */ + // function openTab(args) { + // open(args.url) + // } function slugify(string) { return string diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index 94f1bce7d..9aa65deba 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -551,12 +551,13 @@ class Site { return { urls: this.analyzedUrls, applications: resolve(this.detections).map( - ({ name, confidence, version, icon, website, categories }) => ({ + ({ name, confidence, version, icon, website, cpe, categories }) => ({ name, confidence, version, icon, website, + cpe, categories: categories.reduce( (categories, { id, name }) => ({ ...categories, diff --git a/src/drivers/npm/package.json b/src/drivers/npm/package.json index 6c9e759ca..31ca22f3e 100644 --- a/src/drivers/npm/package.json +++ b/src/drivers/npm/package.json @@ -13,7 +13,7 @@ "software" ], "homepage": "https://www.wappalyzer.com", - "version": "6.0.10", + "version": "6.0.11", "author": "Wappalyzer", "license": "MIT", "repository": { diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index efa4b4833..cfec30b0f 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -268,8 +268,9 @@ const Driver = { // Cache detections const cache = (Driver.cache.hostnames[hostname] = { ...(Driver.cache.hostnames[hostname] || { + url, detections: [], - hits: 0 + hits: incrementHits ? 0 : 1 }), dateTime: Date.now() }) @@ -513,12 +514,20 @@ const Driver = { await Driver.post( 'https://api.wappalyzer.com/ping/v1/', Object.keys(Driver.cache.hostnames).reduce((hostnames, hostname) => { + if ( + /((local|dev(elopment)?|stag(e|ing)?|test(ing)?|demo(shop)?|admin|google|cache)\.|\/admin|\.local)/.test( + hostname + ) + ) { + return + } + // eslint-disable-next-line standard/computed-property-even-spacing - const { language, detections, hits } = Driver.cache.hostnames[ + const { url, language, detections, hits } = Driver.cache.hostnames[ hostname ] - hostnames[hostname] = hostnames[hostname] || { + hostnames[url] = hostnames[url] || { applications: resolve(detections).reduce( (technologies, { name, confidence, version }) => { if (confidence === 100) { diff --git a/src/drivers/webextension/manifest.json b/src/drivers/webextension/manifest.json index c6bb52d67..f90775ed6 100644 --- a/src/drivers/webextension/manifest.json +++ b/src/drivers/webextension/manifest.json @@ -4,7 +4,7 @@ "author": "Wappalyzer", "homepage_url": "https://www.wappalyzer.com", "description": "Identify web technologies", - "version": "6.0.10", + "version": "6.0.11", "default_locale": "en", "manifest_version": 2, "icons": { diff --git a/src/package.json b/src/package.json index 7605454f4..aed9c5ed9 100644 --- a/src/package.json +++ b/src/package.json @@ -13,7 +13,7 @@ "software" ], "homepage": "https://www.wappalyzer.com", - "version": "6.0.10", + "version": "6.0.11", "author": "Wappalyzer", "license": "MIT", "repository": { diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 61191e7fb..0777df65d 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -64,7 +64,7 @@ const Wappalyzer = { .sort((a, b) => (priority(a) > priority(b) ? 1 : -1)) .map( ({ - technology: { name, slug, categories, icon, website }, + technology: { name, slug, categories, icon, website, cpe }, confidence, version }) => ({ @@ -74,7 +74,8 @@ const Wappalyzer = { confidence, version, icon, - website + website, + cpe }) ) }, @@ -223,7 +224,8 @@ const Wappalyzer = { implies, excludes, icon, - website + website, + cpe } = data[name] technologies.push({ @@ -245,7 +247,8 @@ const Wappalyzer = { name: value })), icon: icon || 'default.svg', - website: website || '' + website: website || '', + cpe }) return technologies