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": {
"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"

@ -1732,7 +1732,6 @@
"cats": [
2
],
"html": "<a href=\"[^>]+woltlab\\.com[^<]+<strong>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": {

@ -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 += '</div>'
container.innerHTML = html
}),
}
/**
* Open a tab
*/
function openTab(args) {
open(args.url)
}
// function openTab(args) {
// open(args.url)
// }
function slugify(string) {
return string

@ -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,

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

@ -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) {

@ -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": {

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

@ -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