Update build scripts, add CPE field to NPM driver output

main
Elbert Alias 5 years ago
parent 8a63c3968c
commit 5897fe256a

@ -16,7 +16,8 @@
}, },
"scripts": { "scripts": {
"link": "node ./bin/link.js", "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", "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", "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" "build": "yarn run link && yarn run validate && yarn run prettify && yarn run convert && node ./bin/build.js"

@ -1732,7 +1732,6 @@
"cats": [ "cats": [
2 2
], ],
"html": "<a href=\"[^>]+woltlab\\.com[^<]+<strong>Burning Board",
"icon": "Burning Board.png", "icon": "Burning Board.png",
"implies": [ "implies": [
"PHP", "PHP",
@ -2530,7 +2529,6 @@
"Server": "^Cowboy$" "Server": "^Cowboy$"
}, },
"icon": "Cowboy.png", "icon": "Cowboy.png",
"implies": "Erlang",
"website": "http://ninenines.eu" "website": "http://ninenines.eu"
}, },
"CppCMS": { "CppCMS": {
@ -12494,7 +12492,6 @@
"cats": [ "cats": [
1 1
], ],
"html": "var WCF_PATH[^>]+",
"icon": "Woltlab Community Framework.png", "icon": "Woltlab Community Framework.png",
"implies": "PHP", "implies": "PHP",
"script": "WCF\\..*\\.js", "script": "WCF\\..*\\.js",
@ -12879,7 +12876,6 @@
"Server": "Yaws(?: ([\\d.]+))?\\;version:\\1" "Server": "Yaws(?: ([\\d.]+))?\\;version:\\1"
}, },
"icon": "Yaws.png", "icon": "Yaws.png",
"implies": "Erlang",
"website": "http://yaws.hyber.org" "website": "http://yaws.hyber.org"
}, },
"Yepcomm": { "Yepcomm": {

@ -1,9 +1,5 @@
/** /* eslint-env browser */
* Bookmarklet driver /* globals wappalyzer */
*/
/** global: wappalyzer */
/** global: XMLHttpRequest */
;(function() { ;(function() {
wappalyzer.driver.document = document wappalyzer.driver.document = document
@ -16,6 +12,7 @@
* Log messages to console * Log messages to console
*/ */
wappalyzer.driver.log = (message, source, type) => { wappalyzer.driver.log = (message, source, type) => {
// eslint-disable-next-line no-console
console.log(`[wappalyzer ${type}]`, `[${source}]`, message) console.log(`[wappalyzer ${type}]`, `[${source}]`, message)
} }
@ -54,7 +51,7 @@
if (xhr.readyState === 4 && xhr.status) { if (xhr.readyState === 4 && xhr.status) {
const headers = xhr.getAllResponseHeaders().split('\n') const headers = xhr.getAllResponseHeaders().split('\n')
if (headers.length > 0 && headers[0] != '') { if (headers.length > 0 && headers[0] !== '') {
wappalyzer.log( wappalyzer.log(
`responseHeaders: ${xhr.getAllResponseHeaders()}`, `responseHeaders: ${xhr.getAllResponseHeaders()}`,
'driver' 'driver'
@ -89,7 +86,7 @@
/** /**
* Display apps * Display apps
*/ */
;(wappalyzer.driver.displayApps = (detected) => { wappalyzer.driver.displayApps = (detected) => {
wappalyzer.log('func: displayApps', 'driver') wappalyzer.log('func: displayApps', 'driver')
let first = true let first = true
@ -150,13 +147,14 @@
html += '</div>' html += '</div>'
container.innerHTML = html container.innerHTML = html
}), }
/**
* Open a tab /**
*/ * Open a tab
function openTab(args) { */
open(args.url) // function openTab(args) {
} // open(args.url)
// }
function slugify(string) { function slugify(string) {
return string return string

@ -551,12 +551,13 @@ class Site {
return { return {
urls: this.analyzedUrls, urls: this.analyzedUrls,
applications: resolve(this.detections).map( applications: resolve(this.detections).map(
({ name, confidence, version, icon, website, categories }) => ({ ({ name, confidence, version, icon, website, cpe, categories }) => ({
name, name,
confidence, confidence,
version, version,
icon, icon,
website, website,
cpe,
categories: categories.reduce( categories: categories.reduce(
(categories, { id, name }) => ({ (categories, { id, name }) => ({
...categories, ...categories,

@ -13,7 +13,7 @@
"software" "software"
], ],
"homepage": "https://www.wappalyzer.com", "homepage": "https://www.wappalyzer.com",
"version": "6.0.10", "version": "6.0.11",
"author": "Wappalyzer", "author": "Wappalyzer",
"license": "MIT", "license": "MIT",
"repository": { "repository": {

@ -268,8 +268,9 @@ const Driver = {
// Cache detections // Cache detections
const cache = (Driver.cache.hostnames[hostname] = { const cache = (Driver.cache.hostnames[hostname] = {
...(Driver.cache.hostnames[hostname] || { ...(Driver.cache.hostnames[hostname] || {
url,
detections: [], detections: [],
hits: 0 hits: incrementHits ? 0 : 1
}), }),
dateTime: Date.now() dateTime: Date.now()
}) })
@ -513,12 +514,20 @@ const Driver = {
await Driver.post( await Driver.post(
'https://api.wappalyzer.com/ping/v1/', 'https://api.wappalyzer.com/ping/v1/',
Object.keys(Driver.cache.hostnames).reduce((hostnames, hostname) => { 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 // 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 hostname
] ]
hostnames[hostname] = hostnames[hostname] || { hostnames[url] = hostnames[url] || {
applications: resolve(detections).reduce( applications: resolve(detections).reduce(
(technologies, { name, confidence, version }) => { (technologies, { name, confidence, version }) => {
if (confidence === 100) { if (confidence === 100) {

@ -4,7 +4,7 @@
"author": "Wappalyzer", "author": "Wappalyzer",
"homepage_url": "https://www.wappalyzer.com", "homepage_url": "https://www.wappalyzer.com",
"description": "Identify web technologies", "description": "Identify web technologies",
"version": "6.0.10", "version": "6.0.11",
"default_locale": "en", "default_locale": "en",
"manifest_version": 2, "manifest_version": 2,
"icons": { "icons": {

@ -13,7 +13,7 @@
"software" "software"
], ],
"homepage": "https://www.wappalyzer.com", "homepage": "https://www.wappalyzer.com",
"version": "6.0.10", "version": "6.0.11",
"author": "Wappalyzer", "author": "Wappalyzer",
"license": "MIT", "license": "MIT",
"repository": { "repository": {

@ -64,7 +64,7 @@ const Wappalyzer = {
.sort((a, b) => (priority(a) > priority(b) ? 1 : -1)) .sort((a, b) => (priority(a) > priority(b) ? 1 : -1))
.map( .map(
({ ({
technology: { name, slug, categories, icon, website }, technology: { name, slug, categories, icon, website, cpe },
confidence, confidence,
version version
}) => ({ }) => ({
@ -74,7 +74,8 @@ const Wappalyzer = {
confidence, confidence,
version, version,
icon, icon,
website website,
cpe
}) })
) )
}, },
@ -223,7 +224,8 @@ const Wappalyzer = {
implies, implies,
excludes, excludes,
icon, icon,
website website,
cpe
} = data[name] } = data[name]
technologies.push({ technologies.push({
@ -245,7 +247,8 @@ const Wappalyzer = {
name: value name: value
})), })),
icon: icon || 'default.svg', icon: icon || 'default.svg',
website: website || '' website: website || '',
cpe
}) })
return technologies return technologies